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



50
51
52
53
54
# File 'lib/cbraspag/core/order.rb', line 50

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