Update rails_multisite to 2.0.1.

This commit is contained in:
Guo Xiang Tan 2018-01-19 10:18:04 +08:00
parent 7ed41fae2b
commit 54dc191a91
5 changed files with 4 additions and 27 deletions

View File

@ -275,7 +275,7 @@ GEM
nokogiri (>= 1.6)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
rails_multisite (1.1.2)
rails_multisite (2.0.1)
activerecord (> 4.2, < 6)
railties (> 4.2, < 6)
railties (5.1.4)

View File

@ -12,8 +12,8 @@ end
if Rails.configuration.multisite
Rails.configuration.middleware.swap(
RailsMultisite::ConnectionManagement,
RailsMultisite::ConnectionManagement,
RailsMultisite::Middleware,
RailsMultisite::Middleware,
RailsMultisite::DiscoursePatches.config
)
end

View File

@ -5,18 +5,10 @@ RSpec.describe 'Multisite SiteSettings' do
before do
conn.config_filename = "spec/fixtures/multisite/two_dbs.yml"
conn.load_settings!
conn.remove_class_variable(:@@current_db)
end
after do
conn.clear_settings!
[:@@db_spec_cache, :@@host_spec_cache, :@@default_spec].each do |class_variable|
conn.remove_class_variable(class_variable)
end
conn.set_current_db
end
def cache(name, namespace: true)

View File

@ -5,18 +5,11 @@ RSpec.describe "Running Sidekiq Jobs in Multisite" do
before do
conn.config_filename = "spec/fixtures/multisite/two_dbs.yml"
conn.load_settings!
conn.remove_class_variable(:@@current_db)
SiteSetting.defaults.refresh_site_locale!
end
after do
conn.clear_settings!
[:@@db_spec_cache, :@@host_spec_cache, :@@default_spec].each do |class_variable|
conn.remove_class_variable(class_variable)
end
conn.set_current_db
end
it 'should revert back to the default connection' do

View File

@ -7,8 +7,6 @@ RSpec.describe 'Multisite SiteSettings' do
@original_provider = SiteSetting.provider
SiteSetting.provider = SiteSettings::DbProvider.new(SiteSetting)
conn.config_filename = "spec/fixtures/multisite/two_dbs.yml"
conn.load_settings!
conn.remove_class_variable(:@@current_db)
end
after do
@ -17,12 +15,6 @@ RSpec.describe 'Multisite SiteSettings' do
end
conn.clear_settings!
[:@@db_spec_cache, :@@host_spec_cache, :@@default_spec].each do |class_variable|
conn.remove_class_variable(class_variable)
end
conn.set_current_db
SiteSetting.provider = @original_provider
end