diff options
author | Aurelian Oancea <aurelian@3scale.net> | 2012-06-08 12:41:46 +0200 |
---|---|---|
committer | Aurelian Oancea <aurelian@3scale.net> | 2012-06-08 12:45:01 +0200 |
commit | 79c8c4fed46775f30551f6d4b0c50b9ba397bc54 (patch) | |
tree | 9d1dc6f8d814590bb908d43d5a8db22a0e88b795 /activerecord/lib/active_record | |
parent | 7495b262cf9c1046595d8967d898d197d9764b9c (diff) | |
download | rails-79c8c4fed46775f30551f6d4b0c50b9ba397bc54.tar.gz rails-79c8c4fed46775f30551f6d4b0c50b9ba397bc54.tar.bz2 rails-79c8c4fed46775f30551f6d4b0c50b9ba397bc54.zip |
Don't assign the attributes if the list is empty.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/attribute_assignment.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/attribute_assignment.rb b/activerecord/lib/active_record/attribute_assignment.rb index bf9fe70b31..ca5f7b9c6c 100644 --- a/activerecord/lib/active_record/attribute_assignment.rb +++ b/activerecord/lib/active_record/attribute_assignment.rb @@ -64,7 +64,7 @@ module ActiveRecord # user.name # => "Josh" # user.is_admin? # => true def assign_attributes(new_attributes, options = {}) - return unless new_attributes + return if new_attributes.blank? attributes = new_attributes.stringify_keys multi_parameter_attributes = [] |