From 32709ea41ed1ec2a89590e9bc6656c1ecd462d30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Tue, 12 Jun 2012 10:45:19 -0700 Subject: Merge pull request #6676 from aurelian/master Don't assign the attributes if the list is empty --- activerecord/lib/active_record/attribute_assignment.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') 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 = [] -- cgit v1.2.3