diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-06-19 01:55:33 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-06-21 11:03:06 -0300 |
commit | 40617c7e539b8b70469671619e3c1716edcfbf59 (patch) | |
tree | 6e6535743f79aa859813facce2f51a864215ad5a /activerecord/test/cases | |
parent | 94489a2570c2b922a820e5e150dc33711379ea52 (diff) | |
download | rails-40617c7e539b8b70469671619e3c1716edcfbf59.tar.gz rails-40617c7e539b8b70469671619e3c1716edcfbf59.tar.bz2 rails-40617c7e539b8b70469671619e3c1716edcfbf59.zip |
Merge branch 'acapilleri-update_nested_attributes'
Closes #6675
Conflicts:
activerecord/lib/active_record/attribute_methods/dirty.rb
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/nested_attributes_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/cases/nested_attributes_test.rb b/activerecord/test/cases/nested_attributes_test.rb index 817898f190..16b1eb040e 100644 --- a/activerecord/test/cases/nested_attributes_test.rb +++ b/activerecord/test/cases/nested_attributes_test.rb @@ -772,6 +772,16 @@ module NestedAttributesOnACollectionAssociationTests assert_nothing_raised(NoMethodError) { @pirate.save! } end + def test_numeric_colum_changes_from_zero_to_no_empty_string + Man.accepts_nested_attributes_for(:interests) + Interest.validates_numericality_of(:zine_id) + man = Man.create(:name => 'John') + interest = man.interests.create(:topic=>'bar',:zine_id => 0) + assert interest.save + + assert !man.update_attributes({:interests_attributes => { :id => interest.id, :zine_id => 'foo' }}) + end + private def association_setter |