mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 07:18:06 +08:00
1574485443
This refactoring was automated using the command: bundle exec "ruby refactorings/where_dot_first_to_find_by/app.rb"
13 lines
231 B
Ruby
13 lines
231 B
Ruby
module Jobs
|
|
class CloseTopic < Jobs::Base
|
|
|
|
def execute(args)
|
|
if topic = Topic.find_by(id: args[:topic_id])
|
|
closer = User.find_by(id: args[:user_id])
|
|
topic.auto_close(closer)
|
|
end
|
|
end
|
|
|
|
end
|
|
end
|