def update!(attributes = {}, reload = false)
return true if attributes.empty?
dirty_attributes = {}
model.properties(repository.name).slice(*attributes.keys).each do |property|
dirty_attributes[property] = attributes[property.name] if property
end
changes = repository.update(dirty_attributes, scoped_query)
query.update(attributes)
if identity_map.any? && reload
reload_query = @key_properties.zip(identity_map.keys.transpose).to_hash
model.all(reload_query.merge(attributes)).reload(:fields => attributes.keys)
end
return loaded? ? changes == size : changes > 0
end