Sha256: f5a66fd4563e778845b0df407ccec76284d08a635d1d525da72f698ca60ddd6e

Contents?: true

Size: 292 Bytes

Versions: 1

Compression:

Stored size: 292 Bytes

Contents

class CarrierId1Validator < ActiveModel::EachValidator
  def validate_each(record, attribute, value)
    if (record.print_mark.to_s == "Y" && value.present?) || (record.print_mark.to_s == "N" && value.blank?)
      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/carrier_id1_validator.rb