Sha256: f3680464bdadc39c7d463b41faa11b419560882b4cfb607f43e44a845897a27f

Contents?: true

Size: 296 Bytes

Versions: 1

Compression:

Stored size: 296 Bytes

Contents

class PrintMarkValidator < ActiveModel::EachValidator
  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
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
einvoice-0.1.0 lib/einvoice/validator/print_mark_validator.rb