1
0
Fork 0
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:
Rodrigo Navarro 2011-02-23 10:23:01 -08:00
parent 29399e00c9
commit 0b2412978f

View file

@ -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"