Sha256: 029e9dc67e0c7d671b6359e26b3a394d496ff5c0ccf1055c15792351cb56aaad

Contents?: true

Size: 623 Bytes

Versions: 6

Compression:

Stored size: 623 Bytes

Contents

module Devise
	module Models

		module Notifiable

			extend ActiveSupport::Concern

			def notify_once(message)
				device_tokens.each do |device|
					next unless device.is_valid
					device.notifier.notify_once(message, device) 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

6 entries across 6 versions & 1 rubygems

Version Path
fwt_push_notification_server-0.1.0.b4 lib/devise/models/notifiable.rb
fwt_push_notification_server-0.1.0.b3 lib/devise/models/notifiable.rb
fwt_push_notification_server-0.1.0.b2 lib/devise/models/notifiable.rb
fwt_push_notification_server-0.1.0.b1 lib/devise/models/notifiable.rb
fwt_push_notification_server-0.0.7 lib/devise/models/notifiable.rb
fwt_push_notification_server-0.0.7.b4 lib/devise/models/notifiable.rb