Class: RailsPushNotifications::BaseApp
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- RailsPushNotifications::BaseApp
- Defined in:
- lib/rails-push-notifications/apps/base_app.rb
Overview
Abstract. This class is the base of all application entity type.
Instance Method Summary collapse
-
#push_notifications ⇒ Object
This method will find all notifications owned by this app and push them.
Instance Method Details
#push_notifications ⇒ Object
This method will find all notifications owned by this app and push them.
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/rails-push-notifications/apps/base_app.rb', line 18 def push_notifications pending = find_pending to_send = pending.map do |notification| notification_type.new notification.destinations, notification.data end pusher = build_pusher pusher.push to_send pending.each_with_index do |p, i| p.update_attributes! results: to_send[i].results end end |