Method: Dynamoid::Associations::ManyAssociation#delete_all
- Defined in:
- lib/dynamoid/associations/many_association.rb
#delete_all ⇒ Object
Deletes all members of the association and removes them from the association.
tag.posts.delete_all
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 |