aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/validations/association_validation_test.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-03-20 17:36:22 +0000
committerPratik Naik <pratiknaik@gmail.com>2009-03-20 17:36:22 +0000
commit37283a6aaec244cb484e24b3e9ff165e89eadd64 (patch)
treec7fc73588629c15546428ed1462b254f9e7948b2 /activerecord/test/cases/validations/association_validation_test.rb
parent4367f39dea7eedb1bf6e7f52b4522c695befe1da (diff)
downloadrails-37283a6aaec244cb484e24b3e9ff165e89eadd64.tar.gz
rails-37283a6aaec244cb484e24b3e9ff165e89eadd64.tar.bz2
rails-37283a6aaec244cb484e24b3e9ff165e89eadd64.zip
Deprecate Error#on(attribute) in favour of Errors#[attribute]
Diffstat (limited to 'activerecord/test/cases/validations/association_validation_test.rb')
-rw-r--r--activerecord/test/cases/validations/association_validation_test.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/test/cases/validations/association_validation_test.rb b/activerecord/test/cases/validations/association_validation_test.rb
index 9d9a5e65e4..b1203c12ed 100644
--- a/activerecord/test/cases/validations/association_validation_test.rb
+++ b/activerecord/test/cases/validations/association_validation_test.rb
@@ -14,7 +14,7 @@ class AssociationValidationTest < ActiveRecord::TestCase
assert_nothing_raised { Owner.validates_size_of :pets, :minimum => 1 }
o = Owner.new('name' => 'nopets')
assert !o.save
- assert o.errors.on(:pets)
+ assert o.errors[:pets].any?
pet = o.pets.build('name' => 'apet')
assert o.valid?
end
@@ -25,14 +25,14 @@ class AssociationValidationTest < ActiveRecord::TestCase
assert_nothing_raised { Owner.validates_size_of :pets, :within => 1..2 }
o = Owner.new('name' => 'nopets')
assert !o.save
- assert o.errors.on(:pets)
+ assert o.errors[:pets].any?
pet = o.pets.build('name' => 'apet')
assert o.valid?
2.times { o.pets.build('name' => 'apet') }
assert !o.save
- assert o.errors.on(:pets)
+ assert o.errors[:pets].any?
end
end