active_record_host_pool 0.9.3 → 0.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 273a6f34855e9d46a75b01acfc92c8e221a32fca
4
- data.tar.gz: 8f5b37264165a3ce1aa63fe92419b4f51d36a3df
3
+ metadata.gz: 746fb94750dec52eb06c977d5462405e494a7506
4
+ data.tar.gz: db8a2468e592d02083e7bf41d3e15e270850d733
5
5
  SHA512:
6
- metadata.gz: 512ab8015ac7d4c338d5f69daf057f9011081a0a3d49e70c5144bad3ea091e43077f12469cf30c463ee0e5b9781fd1e138fbb63e9c040558ac5dce50c4cf5f4c
7
- data.tar.gz: 9de71ffdbe484508dc325033ff5a81e9900240fe1a7645ac72a459ccb6179fddc224e9e41b5bcc5a379cce50e12fdb16876f35c26dd01689b987b02fc6f6fa06
6
+ metadata.gz: 8669bb88fe35a49e01b0ec9555df9fbc5e06f7daaa9d296eb53a25b26087e7fe6797d69658ca3e51feacb4256b12dd60971eee9915934a7603213e6fb5d7cb76
7
+ data.tar.gz: 782f375c36b1bdcc74596bb745b87dc7640eaa891fa2f2f5fb44d76a4afc0dde2c06d9edb1e4f2c0f33ee84c591500547da3ffac077d62dd93d6d1e445fc9fb4
@@ -81,18 +81,36 @@ end
81
81
  module ActiveRecord
82
82
  module ConnectionAdapters
83
83
  class ConnectionHandler
84
- def establish_connection(owner, spec)
85
- if ActiveRecord::VERSION::MAJOR >= 4
84
+
85
+ if ActiveRecord::VERSION::MAJOR >= 5
86
+
87
+ def establish_connection(spec)
88
+ owner_to_pool[spec.name] = ActiveRecordHostPool::PoolProxy.new(spec)
89
+ end
90
+
91
+ elsif ActiveRecord::VERSION::MAJOR == 4
92
+
93
+ def establish_connection(owner, spec)
86
94
  @class_to_pool.clear
87
95
  raise RuntimeError, "Anonymous class is not allowed." unless owner.name
88
96
  owner_to_pool[owner.name] = ActiveRecordHostPool::PoolProxy.new(spec)
89
- elsif ActiveRecord::VERSION::MAJOR == 3 && ActiveRecord::VERSION::MINOR == 2
97
+ end
98
+
99
+ elsif ActiveRecord::VERSION::MAJOR == 3 && ActiveRecord::VERSION::MINOR == 2
100
+
101
+ def establish_connection(owner, spec)
90
102
  @connection_pools[spec] ||= ActiveRecordHostPool::PoolProxy.new(spec)
91
103
  @class_to_pool[owner] = @connection_pools[spec]
92
- else
104
+ end
105
+
106
+ else
107
+
108
+ def establish_connection(owner, spec)
93
109
  @connection_pools[owner] = ActiveRecordHostPool::PoolProxy.new(spec)
94
110
  end
111
+
95
112
  end
113
+
96
114
  end
97
115
  end
98
116
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ActiveRecordHostPool
3
- VERSION = "0.9.3"
3
+ VERSION = "0.9.4"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record_host_pool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Osheroff
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-13 00:00:00.000000000 Z
11
+ date: 2016-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  version: '0'
169
169
  requirements: []
170
170
  rubyforge_project:
171
- rubygems_version: 2.4.5.1
171
+ rubygems_version: 2.6.6
172
172
  signing_key:
173
173
  specification_version: 4
174
174
  summary: Allow ActiveRecord to share a connection to multiple databases on the same