aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2017-04-02 14:25:48 +0930
committerGitHub <noreply@github.com>2017-04-02 14:25:48 +0930
commit6f3678ce36bcab6bfbe60f205d2e36615f4afba4 (patch)
tree0e0c5ebf37262d5988fb626ef952b13941626fe4 /activemodel
parenteb180f14f46d11963fa2a725a5657eb16d5900ca (diff)
parentd1ca18d21f3c173af34dfdc3fa34de577178fee9 (diff)
downloadrails-6f3678ce36bcab6bfbe60f205d2e36615f4afba4.tar.gz
rails-6f3678ce36bcab6bfbe60f205d2e36615f4afba4.tar.bz2
rails-6f3678ce36bcab6bfbe60f205d2e36615f4afba4.zip
Merge pull request #28642 from ttanimichi/patch-1
No need to check nil
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/lib/active_model/attribute_assignment.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/attribute_assignment.rb b/activemodel/lib/active_model/attribute_assignment.rb
index 7dad3b6dff..ee130df989 100644
--- a/activemodel/lib/active_model/attribute_assignment.rb
+++ b/activemodel/lib/active_model/attribute_assignment.rb
@@ -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))