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



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

def before_validation
  normalize_token!
end

#validateObject



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

def validate
  super

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