rails_multisite 2.2.2 → 2.3.0
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/connection_management.rb +11 -5
- 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: 2acf52c9b8002bff6a1590222b85d778cb1ddd9e28de6ac91eed45d5117e30aa
|
4
|
+
data.tar.gz: 3b39a8d9a2d2b70c62e29a0541d585c499a51cb9ac6b8dac2544343b1c22d45c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7b8775f143c21083b7141ca6592c5f8d75f12a287f14452a63ff159f0932c0fafe918256d8219431d9d3647b09b340daab747d5b0b10ff3e1c1b1c1f3eeab34
|
7
|
+
data.tar.gz: 81abf0c622d83d541bb0870a7bc2cac379c137ae4057b11a44bc8ab8ff4a6be3e1b730420766b22a55ff3aa7505ef7e9e0ab5494c8c1bdedfc8444e862cf0af0
|
@@ -137,7 +137,18 @@ module RailsMultisite
|
|
137
137
|
:"#{spec.name}#{@handler_key_suffix}"
|
138
138
|
end
|
139
139
|
|
140
|
+
def self.default_connection_handler=(connection_handler)
|
141
|
+
if @instance
|
142
|
+
unless connection_handler.is_a?(ActiveRecord::ConnectionAdapters::ConnectionHandler)
|
143
|
+
raise ArgumentError.new("Invalid connection handler")
|
144
|
+
end
|
145
|
+
|
146
|
+
@instance.default_connection_handler = connection_handler
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
140
150
|
attr_reader :config_filename, :db_spec_cache, :connection_handlers
|
151
|
+
attr_writer :default_connection_handler
|
141
152
|
|
142
153
|
def initialize(config_filename)
|
143
154
|
@config_filename = config_filename
|
@@ -153,7 +164,6 @@ module RailsMultisite
|
|
153
164
|
@db_spec_cache = {}
|
154
165
|
@default_spec = SPEC_KLASS::Resolver.new(ActiveRecord::Base.configurations).spec(Rails.env.to_sym)
|
155
166
|
@default_connection_handler = ActiveRecord::Base.connection_handler
|
156
|
-
@established_default = false
|
157
167
|
|
158
168
|
@reload_mutex = Mutex.new
|
159
169
|
|
@@ -246,10 +256,6 @@ module RailsMultisite
|
|
246
256
|
end
|
247
257
|
else
|
248
258
|
handler = @default_connection_handler
|
249
|
-
if !@established_default
|
250
|
-
handler_establish_connection(handler, spec)
|
251
|
-
@established_default = true
|
252
|
-
end
|
253
259
|
end
|
254
260
|
|
255
261
|
ActiveRecord::Base.connection_handler = handler
|
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.
|
4
|
+
version: 2.3.0
|
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-06-
|
11
|
+
date: 2020-06-10 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
|