From 20f943b5e88f2cfea0255a299c301ebafb4430b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=A0im=C3=A1nek?= Date: Tue, 26 Jan 2016 00:30:46 +0100 Subject: Use Ruby 1.8 compat syntax in test of security fix in activerecord/test/cases/nested_attributes_test.rb. --- activerecord/test/cases/nested_attributes_test.rb | 8 ++++---- 1 file 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 -- cgit v1.2.3