Module: MongoMapper::AcceptsNestedAttributes::ClassMethods

Defined in:
lib/mongo_mapper/accepts_nested_attributes.rb

Instance Method Summary collapse

Instance Method Details

#accepts_nested_attributes_for(*associations) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/mongo_mapper/accepts_nested_attributes.rb', line 6

def accepts_nested_attributes_for(*associations)
  (associations||[]).each do |association|
    # should do a fake nested attributes
    define_method :"#{association}_attributes=" do |*args|
      self.send :"#{association}=", *args
    end
  end
end