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 10:45:19 -0700 |
commit | a268d2dc972c73b9f406002364b633afa0d3d98c (patch) | |
tree | 5bbce63602924c8b3d301905167d0130b0aeaf89 /activerecord/test | |
parent | fa4b0295b62c1ff60d28f267435bfa7d90db5b95 (diff) | |
parent | 79c8c4fed46775f30551f6d4b0c50b9ba397bc54 (diff) | |
download | rails-a268d2dc972c73b9f406002364b633afa0d3d98c.tar.gz rails-a268d2dc972c73b9f406002364b633afa0d3d98c.tar.bz2 rails-a268d2dc972c73b9f406002364b633afa0d3d98c.zip |
Merge pull request #6676 from aurelian/master
Don't assign the attributes if the list is empty
Diffstat (limited to 'activerecord/test')
-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 1b5421c25e..b35dc2d26d 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) |