1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

It should be ActiveModel::Validator, not ActiveRecord::Validator.

This commit is contained in:
Elben Shira 2010-12-14 20:35:08 -06:00
parent 73dafba6ca
commit de4f9acad8

View file

@ -414,7 +414,7 @@ class Person < ActiveRecord::Base
validates_with GoodnessValidator
end
class GoodnessValidator < ActiveRecord::Validator
class GoodnessValidator < ActiveModel::Validator
def validate
if record.first_name == "Evil"
record.errors[:base] << "This person is evil"