Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Revert "Revert "Validators should at model level and not at AR:Base l…

…evel [Closes #4804]""

This reverts commit d675493.
  • Loading branch information...
commit a087bc85fd24e7261ce6a6f63ffa2dbd49db567d 1 parent 6865b5e
@wycats wycats authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 activerecord/test/cases/validations_test.rb
View
10 activerecord/test/cases/validations_test.rb
@@ -9,6 +9,8 @@
require 'models/owner'
require 'models/pet'
require 'models/event'
+require 'models/parrot'
+require 'models/company'
class ProtectedPerson < ActiveRecord::Base
set_table_name 'people'
@@ -189,4 +191,12 @@ def test_validate_is_deprecated_on_update
end
assert_equal ["always invalid", "invalid on update"], p.errors[:name]
end
+
+ def test_validators
+ assert_equal 1, Parrot.validators.size
+ assert_equal 1, Company.validators.size
+ assert_equal 1, Parrot.validators_on(:name).size
+ assert_equal 1, Company.validators_on(:name).size
+ end
+
end
Please sign in to comment.
Something went wrong with that request. Please try again.