mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
extend thredded models with deleted_at
This commit is contained in:
parent
d55fb0896d
commit
f3bcd33658
@ -246,6 +246,8 @@ Rails.application.config.to_prepare do
|
||||
end
|
||||
|
||||
require 'extensions/thredded/topic'
|
||||
require 'extensions/thredded/post'
|
||||
|
||||
Rails.application.config.to_prepare do
|
||||
begin
|
||||
if ActiveRecord::Base.connection.table_exists?(:thredded_topics)
|
||||
@ -253,4 +255,11 @@ Rails.application.config.to_prepare do
|
||||
end
|
||||
rescue ActiveRecord::NoDatabaseError
|
||||
end
|
||||
|
||||
begin
|
||||
if ActiveRecord::Base.connection.table_exists?(:thredded_posts)
|
||||
Thredded::Post.include(Extensions::Thredded::Post)
|
||||
end
|
||||
rescue ActiveRecord::NoDatabaseError
|
||||
end
|
||||
end
|
||||
|
||||
14
lib/extensions/thredded/post.rb
Normal file
14
lib/extensions/thredded/post.rb
Normal file
@ -0,0 +1,14 @@
|
||||
# lib/extensions/thredded/post.rb
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Extensions
|
||||
module Thredded
|
||||
module Post
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
acts_as_paranoid
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -10,6 +10,8 @@ module Extensions
|
||||
after_create :create_content_page_share
|
||||
has_many :content_page_shares, as: :content
|
||||
|
||||
acts_as_paranoid
|
||||
|
||||
def self.icon
|
||||
'forum'
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user