Class: Einvoice::Neweb::Validator::DonateMarkValidator

Inherits:
ActiveModel::EachValidator
  • Object
show all
Defined in:
lib/einvoice/neweb/validator/invoice_validator.rb

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attribute, value) ⇒ Object



14
15
16
17
18
# File 'lib/einvoice/neweb/validator/invoice_validator.rb', line 14

def validate_each(record, attribute, value)
  if value == "1" && record.n_p_o_b_a_n.blank?
    record.errors.add attribute, options[:message] || :invalid
  end
end