Sha256: 8991913b99d4d4b778b237f9cb841951a72aeb2970c72c33ab2b45f9371b90b5

Contents?: true

Size: 458 Bytes

Versions: 11

Compression:

Stored size: 458 Bytes

Contents

module FwtPushNotificationServer
  
  class DeviceToken < ActiveRecord::Base
  
  	validates_uniqueness_of :token
    validates_presence_of :token
    validates_presence_of :provider

  	def user
  		user_id.blank? ? nil : FwtPushNotificationServer.user_class.find_or_create_by(FwtPushNotificationServer.user_key => user_id)
  	end

  	def notifier
  		return nil if provider.nil?
		  FwtPushNotificationServer.notifiers[provider.to_sym]
    end

  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
fwt_push_notification_server-0.1.0.b11 app/models/fwt_push_notification_server/device_token.rb
fwt_push_notification_server-0.1.0.b10 app/models/fwt_push_notification_server/device_token.rb
fwt_push_notification_server-0.1.0.b9 app/models/fwt_push_notification_server/device_token.rb
fwt_push_notification_server-0.1.0.b8 app/models/fwt_push_notification_server/device_token.rb
fwt_push_notification_server-0.1.0.b7 app/models/fwt_push_notification_server/device_token.rb
fwt_push_notification_server-0.1.0.b6 app/models/fwt_push_notification_server/device_token.rb
fwt_push_notification_server-0.1.0.b5 app/models/fwt_push_notification_server/device_token.rb
fwt_push_notification_server-0.1.0.b4 app/models/fwt_push_notification_server/device_token.rb
fwt_push_notification_server-0.1.0.b3 app/models/fwt_push_notification_server/device_token.rb
fwt_push_notification_server-0.1.0.b2 app/models/fwt_push_notification_server/device_token.rb
fwt_push_notification_server-0.1.0.b1 app/models/fwt_push_notification_server/device_token.rb