models: add deletable concern.
This commit is contained in:
@@ -30,7 +30,7 @@ class ForumTopic < ApplicationRecord
|
||||
ModAction.log("locked forum topic ##{id} (title: #{title})", :forum_topic_lock)
|
||||
end
|
||||
|
||||
scope :active, -> { where(is_deleted: false) }
|
||||
deletable
|
||||
|
||||
module CategoryMethods
|
||||
extend ActiveSupport::Concern
|
||||
@@ -158,14 +158,6 @@ class ForumTopic < ApplicationRecord
|
||||
(response_count / Danbooru.config.posts_per_page.to_f).ceil
|
||||
end
|
||||
|
||||
def delete!
|
||||
update(is_deleted: true)
|
||||
end
|
||||
|
||||
def undelete!
|
||||
update(is_deleted: false)
|
||||
end
|
||||
|
||||
def update_orignal_post
|
||||
original_post&.update_columns(:updater_id => updater.id, :updated_at => Time.now)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user