An Og Managed class. Also contains helper methods.

Methods
Included Modules
Public Class methods
model_from_string(str)

Converts a string into it’s corresponding class. Added to support STI. Ex: x = "Dave" becomes: (x.class.name == Dave) == true. Returns nil if there’s no such class.

     # File lib/og/model.rb, line 794
794:     def model_from_string(str)
795:       res = nil
796:       Manager.managed_classes.each do |klass|
797:         if klass.name == str
798:           res = klass
799:           break
800:         end
801:       end
802:       res
803:     end
resolve_primary_key(klass)

Return the primary key for the given class. Search the attributes, try to find one annotated as primary_key. The default primary key is oid.

     # File lib/og/model.rb, line 771
771:     def resolve_primary_key(klass)
772:       # Search the attributes, try to find one annotated as 
773:       # primary_key.
774: 
775:       for a in klass.attributes
776:         anno = klass.ann(a)
777:         if anno[:primary_key]
778:           return a
779:         end
780:       end
781: 
782:       # The default primary key is oid.
783: 
784:       return :oid
785:     end