active_record_host_pool 0.9.4 → 0.9.5

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: 746fb94750dec52eb06c977d5462405e494a7506
4
- data.tar.gz: db8a2468e592d02083e7bf41d3e15e270850d733
3
+ metadata.gz: e15fabd363b8e13ab05d30c7ea4473bba5fad470
4
+ data.tar.gz: 498d652b40f38ce57864a6b33d1a86e446793b3d
5
5
  SHA512:
6
- metadata.gz: 8669bb88fe35a49e01b0ec9555df9fbc5e06f7daaa9d296eb53a25b26087e7fe6797d69658ca3e51feacb4256b12dd60971eee9915934a7603213e6fb5d7cb76
7
- data.tar.gz: 782f375c36b1bdcc74596bb745b87dc7640eaa891fa2f2f5fb44d76a4afc0dde2c06d9edb1e4f2c0f33ee84c591500547da3ffac077d62dd93d6d1e445fc9fb4
6
+ metadata.gz: 87fa9167105a51de5895a20adb1e421acdc0a7a1b81113b8fb8f885530f642a5bdaafeabf9d03c1bd5f54e0c2358e67d46840e44ef2df304c861746b471a97c4
7
+ data.tar.gz: c9f22cd3feae4da0a61a6ca1f748ca8639ed845d0dd9c58d13e5ac1a173d9e0f452b5c5e24f0d222e27f80b11f9396c12aa42f36460a81f1c98cf6ed6d95235b
@@ -10,7 +10,12 @@ module ActiveRecordHostPool
10
10
  module DatabaseSwitch
11
11
  def self.included(base)
12
12
  base.class_eval do
13
- attr_accessor(:_host_pool_current_database)
13
+ attr_reader(:_host_pool_current_database)
14
+
15
+ def _host_pool_current_database=(database)
16
+ @_host_pool_current_database = database
17
+ @config[:database] = _host_pool_current_database if ActiveRecord::VERSION::MAJOR >= 5
18
+ end
14
19
 
15
20
  alias_method :execute_without_switching, :execute
16
21
  alias_method :execute, :execute_with_switching
@@ -64,7 +69,6 @@ module ActiveRecordHostPool
64
69
  log("select_db #{_host_pool_current_database}", "SQL") do
65
70
  clear_cache! if respond_to?(:clear_cache!)
66
71
  raw_connection.select_db(_host_pool_current_database)
67
- @config[:database] = _host_pool_current_database if ActiveRecord::VERSION::MAJOR >= 5
68
72
  end
69
73
  @_cached_current_database = _host_pool_current_database
70
74
  @_cached_connection_object_id = @connection.object_id
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ActiveRecordHostPool
3
- VERSION = "0.9.4"
3
+ VERSION = "0.9.5"
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.4
4
+ version: 0.9.5
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-06-28 00:00:00.000000000 Z
11
+ date: 2016-09-29 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.6.6
171
+ rubygems_version: 2.4.5.1
172
172
  signing_key:
173
173
  specification_version: 4
174
174
  summary: Allow ActiveRecord to share a connection to multiple databases on the same