class ValidatesWithTest::ValidatorThatValidatesOptions

Public Instance Methods

validate(record) click to toggle source
# File activemodel/test/cases/validations/with_validation_test.rb, line 33
def validate(record)
  if options[:field] == :first_name
    record.errors[:base] << ERROR_MESSAGE
  end
end