Class: OrgnoValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- OrgnoValidator
- Defined in:
- lib/orgno_validator.rb
Class Attribute Summary collapse
-
.orgno_mod_11_weights ⇒ Object
Returns the value of attribute orgno_mod_11_weights.
Instance Method Summary collapse
Class Attribute Details
.orgno_mod_11_weights ⇒ Object
Returns the value of attribute orgno_mod_11_weights.
17 18 19 |
# File 'lib/orgno_validator.rb', line 17 def orgno_mod_11_weights @orgno_mod_11_weights end |
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
5 6 7 8 9 |
# File 'lib/orgno_validator.rb', line 5 def validate_each(record, attribute, value) unless OrgnoValidator.valid_orgno?(value) record.errors.add(attribute, [:message] || :invalid) end end |