rails_multisite 1.1.0.rc3 → 1.1.0.rc4

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
  SHA1:
3
- metadata.gz: 9482374c98ac24501bd7ee498b5b256e369f4983
4
- data.tar.gz: fc13d21adba2c269cb1a1e509f051329ff933305
3
+ metadata.gz: 7c34ae44ef4463a47d823ba8d59e9c5b6c3257e9
4
+ data.tar.gz: 3c1acedaacdeea8bb38f46a56db82b81781f1891
5
5
  SHA512:
6
- metadata.gz: 5510ae2b38586780fce33a49ebeb87ae04238ca3813fd2146d34d300cfec525cdec4054b4185ed690a6fb24e784cbde132c95969c48f1d845e8c4fc521dae5a2
7
- data.tar.gz: '0952fd1f2e935419fc8bacaa1f3fdef11d77060249f01a97b20c1c9a63b2a1557f3f387ccb5374b54b7b828e2c8c7a23cb008db8b6cd97db776f29586528b51b'
6
+ metadata.gz: 0565a6ce2976d30d7b8193571aecb024c6640bc0f8fd4f417bbd210d1dcbe325017753e96b94d4b8a2b43ecf8d10824dc11ac487bca9f4ec1fe4fe67b91788d7
7
+ data.tar.gz: b3eba6b046b05dcd8c104e7d5cdbb21af5c3df6348eb987aa20eee9af03df48a20dbd7d345d26100a93b6cb6f7af13f761309e850cd3ef48d8921c4c14807725
@@ -147,7 +147,12 @@ module RailsMultisite
147
147
  end
148
148
  end
149
149
 
150
+ def self.set_current_db
151
+ @@current_db = DEFAULT
152
+ end
153
+
150
154
  def self.current_db
155
+ return @@current_db if defined?(@@current_db)
151
156
  ActiveRecord::Base.connection_pool.spec.config[:db_key] || DEFAULT
152
157
  end
153
158
 
@@ -17,6 +17,8 @@ module RailsMultisite
17
17
  if ENV['RAILS_DB']
18
18
  ConnectionManagement.establish_connection(db: ENV['RAILS_DB'])
19
19
  end
20
+ else
21
+ ConnectionManagement.set_current_db
20
22
  end
21
23
  end
22
24
  end
@@ -1,3 +1,3 @@
1
1
  module RailsMultisite
2
- VERSION = "1.1.0.rc3"
2
+ VERSION = "1.1.0.rc4"
3
3
  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: 1.1.0.rc3
4
+ version: 1.1.0.rc4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-04 00:00:00.000000000 Z
11
+ date: 2017-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord