mirror of https://github.com/rails/rails
Revert "Validators should at model level and not at AR:Base level [Closes #4804]"
This reverts commit e11bb95d56
.
This commit is contained in:
parent
f28d5cfbe6
commit
d675493065
|
@ -9,8 +9,6 @@ require 'models/guid'
|
|||
require 'models/owner'
|
||||
require 'models/pet'
|
||||
require 'models/event'
|
||||
require 'models/parrot'
|
||||
require 'models/company'
|
||||
|
||||
class ProtectedPerson < ActiveRecord::Base
|
||||
set_table_name 'people'
|
||||
|
@ -191,12 +189,4 @@ class ValidationsTest < ActiveRecord::TestCase
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue