Class: DataMapper::Associations::ManyToMany::Proxy

Inherits:
OneToMany::Proxy show all
Defined in:
lib/gems/dm-core-0.9.9/lib/dm-core/associations/many_to_many.rb

Instance Method Summary collapse

Methods inherited from OneToMany::Proxy

#<<, #all, #build, #create, #delete_at, #destroy!, #first, #kind_of?, #new, #pop, #push, #reload, #replace, #respond_to?, #shift, #unshift, #update, #update!

Methods included from DataMapper::Assertions

#assert_kind_of

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class DataMapper::Associations::OneToMany::Proxy

Instance Method Details

#clearObject



86
87
88
89
# File 'lib/gems/dm-core-0.9.9/lib/dm-core/associations/many_to_many.rb', line 86

def clear
  near_association.clear
  super
end

#delete(resource) ⇒ Object



80
81
82
83
84
# File 'lib/gems/dm-core-0.9.9/lib/dm-core/associations/many_to_many.rb', line 80

def delete(resource)
  through = near_association.get(*(@parent.key + resource.key))
  near_association.delete(through)
  orphan_resource(super)
end

#destroyObject



91
92
93
94
# File 'lib/gems/dm-core-0.9.9/lib/dm-core/associations/many_to_many.rb', line 91

def destroy
  near_association.destroy
  super
end

#saveObject



96
97
# File 'lib/gems/dm-core-0.9.9/lib/dm-core/associations/many_to_many.rb', line 96

def save
end