aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/autosave_association_test.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-01-17 14:22:27 +0100
committerJosé Valim <jose.valim@gmail.com>2010-01-17 14:22:34 +0100
commitc0d31ca41b2f019d3bf940ac79f104c412b115bf (patch)
tree4946099ab3a6cdffbb82a3fd78e77a7f4dccef58 /activerecord/test/cases/autosave_association_test.rb
parent020e656447a7cc2ce9cbf83483ab3b31730a565e (diff)
downloadrails-c0d31ca41b2f019d3bf940ac79f104c412b115bf.tar.gz
rails-c0d31ca41b2f019d3bf940ac79f104c412b115bf.tar.bz2
rails-c0d31ca41b2f019d3bf940ac79f104c412b115bf.zip
save(false) is gone, use save(:validate => false) instead.
Diffstat (limited to 'activerecord/test/cases/autosave_association_test.rb')
-rw-r--r--activerecord/test/cases/autosave_association_test.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/activerecord/test/cases/autosave_association_test.rb b/activerecord/test/cases/autosave_association_test.rb
index cc36a6dc5b..cc5460ddb7 100644
--- a/activerecord/test/cases/autosave_association_test.rb
+++ b/activerecord/test/cases/autosave_association_test.rb
@@ -805,7 +805,7 @@ class TestAutosaveAssociationOnAHasOneAssociation < ActiveRecord::TestCase
def test_should_still_allow_to_bypass_validations_on_the_associated_model
@pirate.catchphrase = ''
@pirate.ship.name = ''
- @pirate.save(false)
+ @pirate.save(:validate => false)
# Oracle saves empty string as NULL
if current_adapter?(:OracleAdapter)
assert_equal [nil, nil], [@pirate.reload.catchphrase, @pirate.ship.name]
@@ -820,7 +820,7 @@ class TestAutosaveAssociationOnAHasOneAssociation < ActiveRecord::TestCase
@pirate.catchphrase = ''
@pirate.ship.name = ''
@pirate.ship.parts.each { |part| part.name = '' }
- @pirate.save(false)
+ @pirate.save(:validate => false)
values = [@pirate.reload.catchphrase, @pirate.ship.name, *@pirate.ship.parts.map(&:name)]
# Oracle saves empty string as NULL
@@ -917,7 +917,7 @@ class TestAutosaveAssociationOnABelongsToAssociation < ActiveRecord::TestCase
def test_should_still_allow_to_bypass_validations_on_the_associated_model
@ship.pirate.catchphrase = ''
@ship.name = ''
- @ship.save(false)
+ @ship.save(:validate => false)
# Oracle saves empty string as NULL
if current_adapter?(:OracleAdapter)
assert_equal [nil, nil], [@ship.reload.name, @ship.pirate.catchphrase]
@@ -1029,7 +1029,7 @@ module AutosaveAssociationOnACollectionAssociationTests
@pirate.catchphrase = ''
@pirate.send(@association_name).each { |child| child.name = '' }
- assert @pirate.save(false)
+ assert @pirate.save(:validate => false)
# Oracle saves empty string as NULL
if current_adapter?(:OracleAdapter)
assert_equal [nil, nil, nil], [
@@ -1049,14 +1049,14 @@ module AutosaveAssociationOnACollectionAssociationTests
def test_should_validation_the_associated_models_on_create
assert_no_difference("#{ @association_name == :birds ? 'Bird' : 'Parrot' }.count") do
2.times { @pirate.send(@association_name).build }
- @pirate.save(true)
+ @pirate.save
end
end
def test_should_allow_to_bypass_validations_on_the_associated_models_on_create
assert_difference("#{ @association_name == :birds ? 'Bird' : 'Parrot' }.count", +2) do
2.times { @pirate.send(@association_name).build }
- @pirate.save(false)
+ @pirate.save(:validate => false)
end
end