Skip to content

Commit

Permalink
Revert "Revert "Validators should at model level and not at AR:Base l…
Browse files Browse the repository at this point in the history
…evel [Closes #4804]""

This reverts commit d675493.
  • Loading branch information
wycats committed Jun 13, 2010
1 parent 6865b5e commit a087bc8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions activerecord/test/cases/validations_test.rb
Expand Up @@ -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'
Expand Down Expand Up @@ -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

0 comments on commit a087bc8

Please sign in to comment.