class GroupCommentsNotificationWorker

Public Instance Methods

perform(comment_id) click to toggle source

Sends notification when user comments on feed.

# File app/workers/group_comments_notification_worker.rb, line 5
def perform(comment_id)
  comment = Comment.find(comment_id)
  comment.commentable.shared_with_users.except_user(comment.user).each do |u|
    comment.create_activity(key: comment.parent_id? ? 'comment.create' : 'post.create', owner: comment.user, recipient: u, type: 'Notification')
  end
end