Sha256: e12cd2b70bbb5e088720ef67d302b28823b827d6944168fd896a9eca82dcc2c0

Contents?: true

Size: 647 Bytes

Versions: 7

Compression:

Stored size: 647 Bytes

Contents

module Devise
	module Models

		module Notifiable

			extend ActiveSupport::Concern

			def notify_once(message, payload = nil)
				device_tokens.each do |device|
					next unless device.is_valid
					device.notifier.notify_once(message, device, payload) unless device.notifier.nil?
				end
			end

			def schedule_notification
				device_tokens.each do |device|
					next unless device.is_valid
					device.notifier.add_device_token(device) unless device.notifier.nil?
				end
			end

			def device_tokens
				key = FwtPushNotificationServer.user_key
				FwtPushNotificationServer::DeviceToken.where(:user_id => send(key))
			end

		end

	end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fwt_push_notification_server-0.1.0.b11 lib/devise/models/notifiable.rb
fwt_push_notification_server-0.1.0.b10 lib/devise/models/notifiable.rb
fwt_push_notification_server-0.1.0.b9 lib/devise/models/notifiable.rb
fwt_push_notification_server-0.1.0.b8 lib/devise/models/notifiable.rb
fwt_push_notification_server-0.1.0.b7 lib/devise/models/notifiable.rb
fwt_push_notification_server-0.1.0.b6 lib/devise/models/notifiable.rb
fwt_push_notification_server-0.1.0.b5 lib/devise/models/notifiable.rb