Method: Dynamoid::Associations::ManyAssociation#delete_all

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

#delete_allObject

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

tag.posts.delete_all

Since:

  • 0.2.0



178
179
180
181
182
# File 'lib/dynamoid/associations/many_association.rb', line 178

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