rails_multisite 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rails_multisite might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c4520b9fc9764176e8b5da30cb855e9326df49403655f79d521574140b6e85b9
4
- data.tar.gz: 8402996c6905b34c67b68d78ad4bfae8d2d8d440e0e71f884ff5d18ad68e62d0
3
+ metadata.gz: b3fe0041751b722c29731d43407a107d44873642fa1166d8c28f15a776c35ac9
4
+ data.tar.gz: ed8fedef6ee6ae4e11725f88d0375f17abe62a94a04bb99417b69daad3a2887c
5
5
  SHA512:
6
- metadata.gz: f53da66c5fee3e2871a90051d72b78a87c13307a0efa3dfe443bdee4693f46344d18545e405a6079cd41f7596909a645bfdd3c7b32a362be6a61ccdc7b64f1ef
7
- data.tar.gz: 9e10e10e824f77a79ed1cece3cbacc139d1c13362ed3b9d99e750aac1daca8066971ef8566b0d3df1cf389c9c2619cdefa9c7426ee9fd6e84f0ab6bbaf57b1a8
6
+ metadata.gz: b17dd4868f46d9cddf9a7ec2156d0d7aacc1e359673440e15b723b26ec67750fac5f3da2028e2d1d31f9234979dbe3ef3bd03511d1ea19ecb7c9ec40f10c5fca
7
+ data.tar.gz: e3de9e44f8f4a04b0be895472ad360a32877644f1c7ce2939a674556965070908c5b0dd65d70c7b2ea3962490d4fcccfbd2781798d928d3387c84395426ec2f8
@@ -7,20 +7,28 @@ module RailsMultisite
7
7
  end
8
8
 
9
9
  initializer "RailsMultisite.init" do |app|
10
- Rails.configuration.multisite = false
10
+ app.config.multisite = false
11
11
 
12
12
  config_file = ConnectionManagement.default_config_filename
13
13
  if File.exist?(config_file)
14
14
  ConnectionManagement.config_filename = ConnectionManagement.default_config_filename
15
- Rails.configuration.multisite = true
15
+ app.config.multisite = true
16
16
  Rails.logger.formatter = RailsMultisite::Formatter.new
17
- app.middleware.insert_after(ActionDispatch::Executor, RailsMultisite::Middleware)
18
- app.middleware.delete(ActionDispatch::Executor)
17
+
18
+ if !skip_middleware?(app.config)
19
+ app.middleware.insert_after(ActionDispatch::Executor, RailsMultisite::Middleware)
20
+ app.middleware.delete(ActionDispatch::Executor)
21
+ end
19
22
 
20
23
  if ENV['RAILS_DB'].present?
21
24
  ConnectionManagement.establish_connection(db: ENV['RAILS_DB'], raise_on_missing: true)
22
25
  end
23
26
  end
24
27
  end
28
+
29
+ def skip_middleware?(config)
30
+ return false if !config.respond_to?(:skip_multisite_middleware)
31
+ config.skip_multisite_middleware
32
+ end
25
33
  end
26
34
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
3
  module RailsMultisite
4
- VERSION = "2.1.1"
4
+ VERSION = "2.1.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_multisite
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-13 00:00:00.000000000 Z
11
+ date: 2020-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  - !ruby/object:Gem::Version
86
86
  version: '0'
87
87
  requirements: []
88
- rubygems_version: 3.0.3
88
+ rubygems_version: 3.1.2
89
89
  signing_key:
90
90
  specification_version: 4
91
91
  summary: Multi tenancy support for Rails