Method: Dynamoid::Associations::ManyAssociation#destroy_all

Defined in:
lib/dynamoid/associations/many_association.rb

#destroy_allObject

Destroys all members of the association and removes them from the association.

tag.posts.destroy_all

Since:

  • 0.2.0



166
167
168
169
170
# File 'lib/dynamoid/associations/many_association.rb', line 166

def destroy_all
  objs = target
  source.update_attribute(source_attribute, nil)
  objs.each(&:destroy)
end