Class: Rack::PushNotification::Device

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

Instance Method Summary collapse

Instance Method Details

#before_validationObject



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

def before_validation
  normalize_token!
end

#validateObject



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

def validate
  super

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