Skip to content
This repository
Browse code

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
Yehuda Katz authored June 12, 2010
10  activerecord/test/cases/validations_test.rb
@@ -9,6 +9,8 @@
9 9
 require 'models/owner'
10 10
 require 'models/pet'
11 11
 require 'models/event'
  12
+require 'models/parrot'
  13
+require 'models/company'
12 14
 
13 15
 class ProtectedPerson < ActiveRecord::Base
14 16
   set_table_name 'people'
@@ -189,4 +191,12 @@ def test_validate_is_deprecated_on_update
189 191
     end
190 192
     assert_equal ["always invalid", "invalid on update"], p.errors[:name]
191 193
   end
  194
+
  195
+  def test_validators
  196
+    assert_equal 1, Parrot.validators.size
  197
+    assert_equal 1, Company.validators.size
  198
+    assert_equal 1, Parrot.validators_on(:name).size
  199
+    assert_equal 1, Company.validators_on(:name).size
  200
+  end
  201
+
192 202
 end

0 notes on commit a087bc8

Please sign in to comment.
Something went wrong with that request. Please try again.