2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-07-29 10:34:21 -04:00
|
|
|
module Jobs
|
2019-10-02 00:01:53 -04:00
|
|
|
class UnpinTopic < ::Jobs::Base
|
2015-07-29 10:34:21 -04:00
|
|
|
def execute(args)
|
|
|
|
topic_id = args[:topic_id]
|
|
|
|
|
2024-05-27 06:27:13 -04:00
|
|
|
return if topic_id.blank?
|
2015-07-29 10:34:21 -04:00
|
|
|
|
|
|
|
topic = Topic.find_by(id: topic_id)
|
|
|
|
topic.update_pinned(false) if topic.present?
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|