Class: Einvoice::Validator::Neweb::PrintMarkValidator

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

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attribute, value) ⇒ Object



5
6
7
8
9
# File 'lib/einvoice/neweb/validator/print_mark_validator.rb', line 5

def validate_each(record, attribute, value)
  if value == "Y" && (record.carrier_id1.present? || record.carrier_id2.present? || record.donate_mark == "Y")
    record.errors.add attribute, options[:message] || :invalid
  end
end