mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
assign_attributes should return if argument is blank.
If you are passed an empty hash, then assign_attributes doesn't need to do any work and can just return early. This should fix the failing Agile Web Development tests.
This commit is contained in:
parent
b1178aef3b
commit
3ecf26f48a
1 changed files with 1 additions and 0 deletions
|
@ -15,6 +15,7 @@ module ActiveRecord
|
||||||
if !new_attributes.respond_to?(:stringify_keys)
|
if !new_attributes.respond_to?(:stringify_keys)
|
||||||
raise ArgumentError, "When assigning attributes, you must pass a hash as an argument."
|
raise ArgumentError, "When assigning attributes, you must pass a hash as an argument."
|
||||||
end
|
end
|
||||||
|
return if new_attributes.blank?
|
||||||
|
|
||||||
attributes = new_attributes.stringify_keys
|
attributes = new_attributes.stringify_keys
|
||||||
multi_parameter_attributes = []
|
multi_parameter_attributes = []
|
||||||
|
|
Loading…
Reference in a new issue