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