Class: Rapns::DeviceTokenFormatValidator
- Inherits:
-
ActiveModel::Validator
- Object
- ActiveModel::Validator
- Rapns::DeviceTokenFormatValidator
- Defined in:
- lib/rapns/device_token_format_validator.rb
Instance Method Summary collapse
Instance Method Details
#validate(record) ⇒ Object
4 5 6 7 8 |
# File 'lib/rapns/device_token_format_validator.rb', line 4 def validate(record) if record.device_token !~ /^[a-z0-9]{64}$/ record.errors[:device_token] << "is invalid" end end |