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]
|
|
|
|
|
2021-06-24 05:35:36 -04:00
|
|
|
return unless topic_id.present?
|
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
|