diff --git a/lib/dm-adjust/collection.rb b/lib/dm-adjust/collection.rb index 810b37b..1e60ea7 100644 --- a/lib/dm-adjust/collection.rb +++ b/lib/dm-adjust/collection.rb @@ -17,7 +17,7 @@ def adjust(attributes = {}, reload = false) # # @api public def adjust!(attributes = {}, reload = false) - return true if attributes.empty? + return 0 if attributes.empty? reload_conditions = if reload model_key = model.key(repository.name) @@ -25,7 +25,7 @@ def adjust!(attributes = {}, reload = false) end adjust_attributes = adjust_attributes(attributes) - repository.adjust(adjust_attributes, self) + affected_resource_count = repository.adjust(adjust_attributes, self) if reload_conditions @query.clear @@ -33,7 +33,7 @@ def adjust!(attributes = {}, reload = false) self.reload end - true + affected_resource_count end private