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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6cf1529e713938afd1edfb04e2e52f8199f86901f3278821d8514c9bc5855b27
4
- data.tar.gz: b5d16cf92694fe94445a141ebc0e8bf2817b665d9789f3ba0ac79ef7af369ed4
3
+ metadata.gz: 2acf52c9b8002bff6a1590222b85d778cb1ddd9e28de6ac91eed45d5117e30aa
4
+ data.tar.gz: 3b39a8d9a2d2b70c62e29a0541d585c499a51cb9ac6b8dac2544343b1c22d45c
5
5
  SHA512:
6
- metadata.gz: 7ecfa664b8367ebd065ecfee14ab1f52ab613aef1c7d404c2944cbedcc93c45899ef53544ca6915260aca0cd5ed6823e6b1bf032569f69fce3001bdaccda12bf
7
- data.tar.gz: d3bb77f2e4906ae9736fba551c40972be4a9bd15777447cb5eaaf45d8dc0b0ecf9fa23d1c2baf09dd4b20304776b2b8f7c929aa2173846d64219c73885be6ccf
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
3
  module RailsMultisite
4
- VERSION = "2.2.2"
4
+ VERSION = "2.3.0"
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.2.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-02 00:00:00.000000000 Z
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.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