I try to follow http://api.rubyonrails.org/classes/ActiveModel/Validator.html , but where should I put the
class MyValidator < ActiveModel::Validator
def validate(record)
if some_complex_logic
record.errors[:base] = "This record is invalid"
end
end
private
def some_complex_logic
# ...
end
end