From e94caf0788df87b139e575f33cdeea12b06f2609 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Fri, 9 Oct 2009 15:37:10 +0100 Subject: Store entire options hash in the class var rather than just the reject_if proc for the nested attributes --- activerecord/test/cases/nested_attributes_test.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'activerecord/test/cases') diff --git a/activerecord/test/cases/nested_attributes_test.rb b/activerecord/test/cases/nested_attributes_test.rb index e57e361520..2a2a19fd4c 100644 --- a/activerecord/test/cases/nested_attributes_test.rb +++ b/activerecord/test/cases/nested_attributes_test.rb @@ -29,13 +29,13 @@ class TestNestedAttributesInGeneral < ActiveRecord::TestCase Pirate.accepts_nested_attributes_for :ship, :allow_destroy => true, :reject_if => proc { |attributes| attributes.empty? } end - def test_base_should_have_an_empty_reject_new_nested_attributes_procs - assert_equal Hash.new, ActiveRecord::Base.reject_new_nested_attributes_procs + def test_base_should_have_an_empty_nested_attributes_options + assert_equal Hash.new, ActiveRecord::Base.nested_attributes_options end - def test_should_add_a_proc_to_reject_new_nested_attributes_procs + def test_should_add_a_proc_to_nested_attributes_options [:parrots, :birds, :birds_with_reject_all_blank].each do |name| - assert_instance_of Proc, Pirate.reject_new_nested_attributes_procs[name] + assert_instance_of Proc, Pirate.nested_attributes_options[name][:reject_if] end end -- cgit v1.2.3