cirandas.net

ref: master

plugins/push_notification/lib/push_notification_plugin/observers/comment_observer.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
module PushNotificationPlugin::Observers
  module CommentObserver
    def comment_after_create_callback(comment)
      users = comment.source.person_followers.map{|p| p.user}

      send_to_users("new_comment",
                    users,
                    {:event => "New Comment",
                     :article => comment.source.id,
                     :comment_body => comment.body,
                     :comment_title => comment.title,
                     :comment_name => comment.name,
                     :author => comment.author.name})
    end
  end
end