mirror of
https://github.com/discourse/discourse.git
synced 2025-02-14 07:14:55 +00:00
427d54b2b0
Zeitwerk simplifies working with dependencies in dev and makes it easier reloading class chains. We no longer need to use Rails "require_dependency" anywhere and instead can just use standard Ruby patterns to require files. This is a far reaching change and we expect some followups here.
16 lines
439 B
Ruby
16 lines
439 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Jobs
|
|
class NotifyCategoryChange < ::Jobs::Base
|
|
def execute(args)
|
|
post = Post.find_by(id: args[:post_id])
|
|
|
|
if post&.topic&.visible?
|
|
post_alerter = PostAlerter.new
|
|
post_alerter.notify_post_users(post, User.where(id: args[:notified_user_ids]))
|
|
post_alerter.notify_first_post_watchers(post, post_alerter.category_watchers(post.topic))
|
|
end
|
|
end
|
|
end
|
|
end
|