Class: Congo::ContentType
- Inherits:
-
Object
- Object
- Congo::ContentType
- Includes:
- Migration, Validation, MongoMapper::Document
- Defined in:
- lib/congo/content_type.rb
Instance Method Summary collapse
-
#embedded ⇒ Object
keys.
-
#scope ⇒ Object
associations.
-
#to_const ⇒ Object
methods.
Methods included from Migration
Methods included from Validation
Instance Method Details
#embedded ⇒ Object
keys
8 |
# File 'lib/congo/content_type.rb', line 8 key :embedded, Boolean, :default => false |
#scope ⇒ Object
associations
17 |
# File 'lib/congo/content_type.rb', line 17 belongs_to :scope, :polymorphic => true |
#to_const ⇒ Object
methods
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/congo/content_type.rb', line 30 def to_const klass = Class.new if self. klass.send(:include, MongoMapper::EmbeddedDocument) else klass.send(:include, MongoMapper::Document) klass. set_collection_name(klass) apply_scope(klass) end klass.class_eval <<-EOV def content_type @content_type ||= self.class.content_type end def self.content_type Congo::ContentType.find('#{self._id}') end EOV (klass) apply_migration(klass) klass end |