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.6.4 app/validators/ico_validator.rb
egov_utils-0.6.3 app/validators/ico_validator.rb
egov_utils-0.6.2 app/validators/ico_validator.rb
egov_utils-0.6.1 app/validators/ico_validator.rb
egov_utils-0.6.0 app/validators/ico_validator.rb
egov_utils-0.5.2 app/validators/ico_validator.rb
egov_utils-0.5.1 app/validators/ico_validator.rb
egov_utils-0.5.0 app/validators/ico_validator.rb
egov_utils-0.4.18 app/validators/ico_validator.rb
egov_utils-0.4.17 app/validators/ico_validator.rb
egov_utils-0.4.16 app/validators/ico_validator.rb
egov_utils-0.4.15 app/validators/ico_validator.rb
egov_utils-0.4.14 app/validators/ico_validator.rb
egov_utils-0.4.13 app/validators/ico_validator.rb
egov_utils-0.4.10 app/validators/ico_validator.rb
egov_utils-0.4.9 app/validators/ico_validator.rb
egov_utils-0.4.7 app/validators/ico_validator.rb
egov_utils-0.4.6 app/validators/ico_validator.rb
egov_utils-0.4.5 app/validators/ico_validator.rb
egov_utils-0.4.4 app/validators/ico_validator.rb