Class: Braspag::Order::InstallmentsTypeValidator

Inherits:
ActiveModel::EachValidator
  • Object
show all
Defined in:
lib/cbraspag/core/order.rb

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attribute, value) ⇒ Object



104
105
106
107
108
# File 'lib/cbraspag/core/order.rb', line 104

def validate_each(record, attribute, value)
  if Braspag::INTEREST.key(value).nil?
    record.errors.add attribute, "invalid installments type"
  end
end