Sha256: c83e506e168565ad65c0a6e33276f3862f5dd236bb2affb78090d27b1b0eed89

Contents?: true

Size: 404 Bytes

Versions: 1

Compression:

Stored size: 404 Bytes

Contents

module Einvoice
  module Validator
    module Neweb
      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
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
einvoice-0.2.0 lib/einvoice/neweb/validator/carrier_id1_validator.rb