# File lib/dm-core/collection.rb, line 417 def destroy! # TODO: delegate to Model.destroy if loaded? return false unless repository.delete(scoped_query) == size each do |resource| resource.instance_variable_set(:@new_record, true) identity_map.delete(resource.key) resource.dirty_attributes.clear model.properties(repository.name).each do |property| next unless resource.attribute_loaded?(property.name) resource.dirty_attributes[property] = property.get(resource) end end else return false unless repository.delete(scoped_query) > 0 end clear true end