discourse/app/jobs/regular/close_topic.rb
Louis Rose 1574485443 Perform the where(...).first to find_by(...) refactoring.
This refactoring was automated using the command: bundle exec "ruby refactorings/where_dot_first_to_find_by/app.rb"
2014-05-06 14:41:59 +01:00

12 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