1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #28642 from ttanimichi/patch-1

No need to check nil
This commit is contained in:
Matthew Draper 2017-04-02 14:25:48 +09:30 committed by GitHub
commit 6f3678ce36

View file

@ -27,7 +27,7 @@ module ActiveModel
if !new_attributes.respond_to?(:stringify_keys)
raise ArgumentError, "When assigning attributes, you must pass a hash as an argument."
end
return if new_attributes.nil? || new_attributes.empty?
return if new_attributes.empty?
attributes = new_attributes.stringify_keys
_assign_attributes(sanitize_for_mass_assignment(attributes))