mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fixing wrong class name.
This commit is contained in:
parent
29399e00c9
commit
0b2412978f
1 changed files with 1 additions and 1 deletions
|
@ -436,7 +436,7 @@ class Person < ActiveRecord::Base
|
|||
validates_with GoodnessValidator, :fields => [:first_name, :last_name]
|
||||
end
|
||||
|
||||
class GoodnessValidator < ActiveRecord::Validator
|
||||
class GoodnessValidator < ActiveModel::Validator
|
||||
def validate(record)
|
||||
if options[:fields].any?{|field| record.send(field) == "Evil" }
|
||||
record.errors[:base] << "This person is evil"
|
||||
|
|
Loading…
Reference in a new issue