Class: Rack::PushNotification::Device

Inherits:
Sequel::Model
  • Object
show all
Defined in:
lib/rack/push-notification/device.rb

Instance Method Summary collapse

Instance Method Details

#before_validationObject



15
16
17
# File 'lib/rack/push-notification/device.rb', line 15

def before_validation
  normalize_token!
end

#validateObject



19
20
21
22
23
# File 'lib/rack/push-notification/device.rb', line 19

def validate
  validates_presence :token
  validates_unique :token
  validates_format /[[:xdigit:]]{40}/, :token
end