aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2016-01-25 15:37:07 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2016-01-25 15:37:07 -0800
commitc9d336382a503769b331113ee11d6b09a6f8583b (patch)
tree48d716c8c279fe63f69f7bb55851762b4fa9e0bf /activerecord
parent3b4398bb605cc7b6f475bf76c19aa0702700a199 (diff)
parent20f943b5e88f2cfea0255a299c301ebafb4430b3 (diff)
downloadrails-c9d336382a503769b331113ee11d6b09a6f8583b.tar.gz
rails-c9d336382a503769b331113ee11d6b09a6f8583b.tar.bz2
rails-c9d336382a503769b331113ee11d6b09a6f8583b.zip
Merge pull request #23250 from simi/3-2-stable-1-8
Fix 3-2-stable 1.8 compatibility.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/cases/nested_attributes_test.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/test/cases/nested_attributes_test.rb b/activerecord/test/cases/nested_attributes_test.rb
index f5f0517681..0a70bb0ccd 100644
--- a/activerecord/test/cases/nested_attributes_test.rb
+++ b/activerecord/test/cases/nested_attributes_test.rb
@@ -148,15 +148,15 @@ class TestNestedAttributesInGeneral < ActiveRecord::TestCase
end
def test_reject_if_is_not_short_circuited_if_allow_destroy_is_false
- Pirate.accepts_nested_attributes_for :ship, reject_if: ->(a) { a[:name] == "The Golden Hind" }, allow_destroy: false
+ Pirate.accepts_nested_attributes_for :ship, :reject_if => lambda {|a| a[:name] == "The Golden Hind" }, :allow_destroy => false
- pirate = Pirate.create!(catchphrase: "Stop wastin' me time", ship_attributes: { name: "White Pearl", _destroy: "1" })
+ pirate = Pirate.create!(:catchphrase => "Stop wastin' me time", :ship_attributes => { :name => "White Pearl", :_destroy => "1" })
assert_equal "White Pearl", pirate.reload.ship.name
- pirate.update!(ship_attributes: { id: pirate.ship.id, name: "The Golden Hind", _destroy: "1" })
+ pirate.update_attributes(:ship_attributes => { :id => pirate.ship.id, :name => "The Golden Hind", :_destroy => "1" })
assert_equal "White Pearl", pirate.reload.ship.name
- pirate.update!(ship_attributes: { id: pirate.ship.id, name: "Black Pearl", _destroy: "1" })
+ pirate.update_attributes(:ship_attributes => { :id => pirate.ship.id, :name => "Black Pearl", :_destroy => "1" })
assert_equal "Black Pearl", pirate.reload.ship.name
end