Skip to content

Instantly share code, notes, and snippets.

@drusepth
Last active June 4, 2020 02:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drusepth/49ba08ec5476a8428647fcc3b4d62722 to your computer and use it in GitHub Desktop.
Save drusepth/49ba08ec5476a8428647fcc3b4d62722 to your computer and use it in GitHub Desktop.
config/initializers/thredded.rb
# config/initializers/thredded.rb
# ...
# snip
# ...
require 'extensions/thredded/topic'
Rails.application.config.to_prepare do
begin
if ActiveRecord::Base.connection.table_exists?(:thredded_topics)
Thredded::Topic.include(Extensions::Thredded::Topic)
end
rescue ActiveRecord::NoDatabaseError
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment