diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-06-12 10:45:19 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-06-12 14:47:52 -0300 |
commit | 32709ea41ed1ec2a89590e9bc6656c1ecd462d30 (patch) | |
tree | 8df23958c88580d8f0ae5b17b4567419645a4ad9 /activerecord/test/cases/mass_assignment_security_test.rb | |
parent | 6522a127e549040d834196eea6eb2818e5051dba (diff) | |
download | rails-32709ea41ed1ec2a89590e9bc6656c1ecd462d30.tar.gz rails-32709ea41ed1ec2a89590e9bc6656c1ecd462d30.tar.bz2 rails-32709ea41ed1ec2a89590e9bc6656c1ecd462d30.zip |
Merge pull request #6676 from aurelian/master
Don't assign the attributes if the list is empty
Diffstat (limited to 'activerecord/test/cases/mass_assignment_security_test.rb')
-rw-r--r-- | activerecord/test/cases/mass_assignment_security_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/cases/mass_assignment_security_test.rb b/activerecord/test/cases/mass_assignment_security_test.rb index 8122857f52..e47b06f244 100644 --- a/activerecord/test/cases/mass_assignment_security_test.rb +++ b/activerecord/test/cases/mass_assignment_security_test.rb @@ -98,6 +98,10 @@ class MassAssignmentSecurityTest < ActiveRecord::TestCase Firm.new.assign_attributes(nil) end + def test_mass_assigning_does_not_choke_on_empty_hash + Firm.new.assign_attributes({}) + end + def test_assign_attributes_uses_default_role_when_no_role_is_provided p = LoosePerson.new p.assign_attributes(attributes_hash) |