Module: MongoTree::Strategies::ChildLink

Includes:
Base
Defined in:
lib/mongo_tree/strategies/child_link.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/mongo_tree/strategies/child_link.rb', line 6

def self.included(base)
  base.class_eval do
    key :child_id, ObjectId, :index => true
    many :children, :class_name => self.name, :foreign_key => "child_id"
  end
  
  base.extend ClassMethods
  base.send :include, InstanceMethods
end