Class: Thredded::AutoFollowAndNotifyJob

Inherits:
ActiveJob::Base
  • Object
show all
Defined in:
app/jobs/thredded/auto_follow_and_notify_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(post_id) ⇒ Object


7
8
9
10
11
12
13
# File 'app/jobs/thredded/auto_follow_and_notify_job.rb', line 7

def perform(post_id)
  post = Thredded::Post.find_by(id: post_id)
  return if post.nil? || post.postable.nil?

  Thredded::AutofollowUsers.new(post).run
  Thredded::NotifyFollowingUsers.new(post).run
end