Sha256: 678defb79d0d0998cf6a447e69e26cedc9265aa2c91490131344b5c5b36710f8

Contents?: true

Size: 232 Bytes

Versions: 119

Compression:

Stored size: 232 Bytes

Contents

class IcoValidator < ActiveModel::EachValidator
  def validate_each(record, attribute, value)
    unless !value.nil? && value =~ /\A\d{7,9}\z/
      record.errors.add(attribute, (options[:message] || :ico_format))
    end
  end
end

Version data entries

119 entries across 119 versions & 1 rubygems

Version Path
egov_utils-0.2.8 app/validators/ico_validator.rb
egov_utils-0.2.7 app/validators/ico_validator.rb
egov_utils-0.2.6 app/validators/ico_validator.rb
egov_utils-0.2.5 app/validators/ico_validator.rb
egov_utils-0.2.4 app/validators/ico_validator.rb
egov_utils-0.2.3 app/validators/ico_validator.rb
egov_utils-0.2.2 app/validators/ico_validator.rb
egov_utils-0.2.1 app/validators/ico_validator.rb
egov_utils-0.2.0 app/validators/ico_validator.rb
egov_utils-0.1.37 app/validators/ico_validator.rb
egov_utils-0.1.36 app/validators/ico_validator.rb
egov_utils-0.1.35 app/validators/ico_validator.rb
egov_utils-0.1.33 app/validators/ico_validator.rb
egov_utils-0.1.32 app/validators/ico_validator.rb
egov_utils-0.1.31 app/validators/ico_validator.rb
egov_utils-0.1.30 app/validators/ico_validator.rb
egov_utils-0.1.29 app/validators/ico_validator.rb
egov_utils-0.1.28 app/validators/ico_validator.rb
egov_utils-0.1.27 app/validators/ico_validator.rb
egov_utils-0.1.26 app/validators/ico_validator.rb