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 +4 -4
- data/lib/rails_multisite/railtie.rb +12 -4
- data/lib/rails_multisite/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3fe0041751b722c29731d43407a107d44873642fa1166d8c28f15a776c35ac9
|
4
|
+
data.tar.gz: ed8fedef6ee6ae4e11725f88d0375f17abe62a94a04bb99417b69daad3a2887c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
15
|
+
app.config.multisite = true
|
16
16
|
Rails.logger.formatter = RailsMultisite::Formatter.new
|
17
|
-
|
18
|
-
app.
|
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
|
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.
|
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-
|
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.
|
88
|
+
rubygems_version: 3.1.2
|
89
89
|
signing_key:
|
90
90
|
specification_version: 4
|
91
91
|
summary: Multi tenancy support for Rails
|