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:
parent
73dafba6ca
commit
de4f9acad8
1 changed files with 1 additions and 1 deletions
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue