rails_multisite 2.1.0 → 2.1.1

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: e9d253acd86ab0b218a43d6cf67bc7bd3948b03c8288872f75c8788ff1c54373
4
- data.tar.gz: 1141a30cad5dba7992b6adc5ab1c315488789430f9bee82ba4bb0b189447d27c
3
+ metadata.gz: c4520b9fc9764176e8b5da30cb855e9326df49403655f79d521574140b6e85b9
4
+ data.tar.gz: 8402996c6905b34c67b68d78ad4bfae8d2d8d440e0e71f884ff5d18ad68e62d0
5
5
  SHA512:
6
- metadata.gz: 6a2a3ac0846e4b589a44e5285d8bba6be418e0a535c642a95f23073dcf16d51425e87d27ed74e5e58b04e25a5cc88620d7937530bd25285dd013d8e81689fb6e
7
- data.tar.gz: 5520157f4aed32cc36b03e289ccb56b4f43385f7a153f64245a4ab570b13138826b8cf1d2aaac78b40b1d7231501575a53df4af0f1d56472ef267e82f90f6d92
6
+ metadata.gz: f53da66c5fee3e2871a90051d72b78a87c13307a0efa3dfe443bdee4693f46344d18545e405a6079cd41f7596909a645bfdd3c7b32a362be6a61ccdc7b64f1ef
7
+ data.tar.gz: 9e10e10e824f77a79ed1cece3cbacc139d1c13362ed3b9d99e750aac1daca8066971ef8566b0d3df1cf389c9c2619cdefa9c7426ee9fd6e84f0ab6bbaf57b1a8
@@ -98,6 +98,13 @@ module RailsMultisite
98
98
  config[:host_names].nil? ? config[:host] : config[:host_names].first
99
99
  end
100
100
 
101
+ def self.current_db_hostnames
102
+ spec = @instance.connection_spec(db: self.current_db) if @instance
103
+ spec ||= ActiveRecord::Base.connection_pool.spec
104
+ config = spec.config
105
+ config[:host_names].nil? ? [config[:host]] : config[:host_names]
106
+ end
107
+
101
108
  def self.connection_spec(opts)
102
109
  if @instance
103
110
  @instance.connection_spec(opts)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  #
3
3
  module RailsMultisite
4
- VERSION = "2.1.0"
4
+ VERSION = "2.1.1"
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.0
4
+ version: 2.1.1
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-01 00:00:00.000000000 Z
11
+ date: 2020-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord