Class: Aquasync::Validator
- Inherits:
-
ActiveModel::Validator
- Object
- ActiveModel::Validator
- Aquasync::Validator
- Defined in:
- lib/validators/aquasync_validator.rb
Overview
Has a responsibility to implement AquasyncModel validations.
Instance Method Summary collapse
Instance Method Details
#validate(record) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/validators/aquasync_validator.rb', line 10 def validate(record) record.validates_presence_of :gid record.validates_format_of :gid, with: /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/ record.validates_presence_of :ust record.validates_presence_of :deviceToken record.validates_format_of :deviceToken, with: /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/ record.validates_presence_of :localTimestamp end |