active_record_host_pool 0.10.1 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 336ed17f3718db418f1f757a17a81fbb0e24da41
4
- data.tar.gz: a3902cee8a77566286c728feb6511d397a80e5a6
2
+ SHA256:
3
+ metadata.gz: '018bdc07dc5428ae890589b96fbf3748d46ef5abc2625c61278ac50ffa079923'
4
+ data.tar.gz: 101a032eba4e5628106fd4ae8a83c66f52bb68d89f0baad5180ec41c83a932ab
5
5
  SHA512:
6
- metadata.gz: def4a6ebe3b0069c2de4374c46b33c93d739511b0b8c893cc9e12797dc6fc94e449b9971b2214053c29e9572fc993ffdccec49a440266ee974d7976ec7adbc63
7
- data.tar.gz: 520d09bd7360556db30a3a0289acc3b5defca029919998d521d9160cc00ada03029f7b8aab9ab209594cad77e70048e60417a5382b9588609da7964b6e0f42b9
6
+ metadata.gz: 1ea8bf1c7704be6d72c97be06dfc084a2a66aa0e64848fcabcbbbcb6c73b360517f9737eac8d0e6459e8b6c85d236d36ea7f2a8bf8ed697a46c9d2eb0eca5d3a
7
+ data.tar.gz: 6eeb13fbd13582106e01bd8fc8a560eeef690d4c375926d17ebccae96b385ca8d4d3e2a75372fc99efad09e7e1bc90e06fc4417d21b3e5deada1ee940f8e347a
@@ -1,11 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- ['mysql_adapter', 'mysql2_adapter'].each do |adapter|
4
- begin
5
- require "active_record/connection_adapters/#{adapter}"
6
- rescue LoadError
7
- end
8
- end
3
+ require "active_record/connection_adapters/mysql2_adapter"
9
4
 
10
5
  module ActiveRecordHostPool
11
6
  module DatabaseSwitch
@@ -132,7 +127,4 @@ module ActiveRecord
132
127
  end
133
128
  end
134
129
 
135
- ["MysqlAdapter", "Mysql2Adapter"].each do |k|
136
- next unless ActiveRecord::ConnectionAdapters.const_defined?(k)
137
- ActiveRecord::ConnectionAdapters.const_get(k).class_eval { include ActiveRecordHostPool::DatabaseSwitch }
138
- end
130
+ ActiveRecord::ConnectionAdapters::Mysql2Adapter.include(ActiveRecordHostPool::DatabaseSwitch)
@@ -35,8 +35,8 @@ module ActiveRecordHostPool
35
35
  end
36
36
 
37
37
  # Override Delegator#respond_to_missing? to allow private methods to be accessed without warning
38
- def respond_to_missing?(m, include_private)
39
- __getobj__.respond_to?(m, include_private)
38
+ def respond_to_missing?(name, include_private)
39
+ __getobj__.respond_to?(name, include_private)
40
40
  end
41
41
 
42
42
  def private_methods(all = true)
@@ -86,13 +86,7 @@ module ActiveRecordHostPool
86
86
 
87
87
  def rescuable_errors
88
88
  @rescuable_errors ||= begin
89
- e = []
90
- if Object.const_defined?("Mysql")
91
- e << Mysql::Error
92
- end
93
- if Object.const_defined?("Mysql2")
94
- e << Mysql2::Error
95
- end
89
+ e = [Mysql2::Error]
96
90
  if ActiveRecord.const_defined?("NoDatabaseError")
97
91
  e << ActiveRecord::NoDatabaseError
98
92
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveRecordHostPool
4
- VERSION = "0.10.1"
4
+ VERSION = "0.11.0"
5
5
  end
data/test/helper.rb CHANGED
@@ -23,7 +23,7 @@ module ARHPTestSetup
23
23
 
24
24
  def arhp_create_models
25
25
  return if Object.const_defined?('Test1')
26
- eval <<-EOL
26
+ eval <<-RUBY
27
27
  class Test1 < ActiveRecord::Base
28
28
  self.table_name = "tests"
29
29
  establish_connection(:test_host_1_db_1)
@@ -53,7 +53,7 @@ module ARHPTestSetup
53
53
  self.table_name = "tests"
54
54
  establish_connection(:test_host_2_db_5)
55
55
  end
56
- EOL
56
+ RUBY
57
57
  end
58
58
 
59
59
  def current_database(klass)
data/test/test_arhp.rb CHANGED
@@ -46,6 +46,7 @@ class ActiveRecordHostPoolTest < Minitest::Test
46
46
  # Relies on connection.class returning the real class
47
47
  Test1.connection.class.class_eval do
48
48
  private
49
+
49
50
  def test_private_method
50
51
  true
51
52
  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.10.1
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Osheroff
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-11 00:00:00.000000000 Z
11
+ date: 2018-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: 3.2.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '5.2'
22
+ version: '6.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,15 +29,15 @@ dependencies:
29
29
  version: 3.2.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '5.2'
32
+ version: '6.0'
33
33
  - !ruby/object:Gem::Dependency
34
- name: wwtd
34
+ name: mysql2
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
39
  version: '0'
40
- type: :development
40
+ type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
@@ -45,7 +45,7 @@ dependencies:
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
47
  - !ruby/object:Gem::Dependency
48
- name: mysql2
48
+ name: bump
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - ">="
@@ -59,21 +59,21 @@ dependencies:
59
59
  - !ruby/object:Gem::Version
60
60
  version: '0'
61
61
  - !ruby/object:Gem::Dependency
62
- name: rake
62
+ name: mocha
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - ">="
66
66
  - !ruby/object:Gem::Version
67
- version: 12.0.0
67
+ version: '0'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - ">="
73
73
  - !ruby/object:Gem::Version
74
- version: 12.0.0
74
+ version: '0'
75
75
  - !ruby/object:Gem::Dependency
76
- name: shoulda
76
+ name: phenix
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
79
  - - ">="
@@ -87,35 +87,35 @@ dependencies:
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  - !ruby/object:Gem::Dependency
90
- name: mocha
90
+ name: rake
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - ">="
94
94
  - !ruby/object:Gem::Version
95
- version: '0'
95
+ version: 12.0.0
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - ">="
101
101
  - !ruby/object:Gem::Version
102
- version: '0'
102
+ version: 12.0.0
103
103
  - !ruby/object:Gem::Dependency
104
- name: bump
104
+ name: rubocop
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - ">="
108
108
  - !ruby/object:Gem::Version
109
- version: '0'
109
+ version: 0.55.0
110
110
  type: :development
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - ">="
115
115
  - !ruby/object:Gem::Version
116
- version: '0'
116
+ version: 0.55.0
117
117
  - !ruby/object:Gem::Dependency
118
- name: phenix
118
+ name: shoulda
119
119
  requirement: !ruby/object:Gem::Requirement
120
120
  requirements:
121
121
  - - ">="
@@ -129,19 +129,19 @@ dependencies:
129
129
  - !ruby/object:Gem::Version
130
130
  version: '0'
131
131
  - !ruby/object:Gem::Dependency
132
- name: rubocop
132
+ name: wwtd
133
133
  requirement: !ruby/object:Gem::Requirement
134
134
  requirements:
135
135
  - - ">="
136
136
  - !ruby/object:Gem::Version
137
- version: 0.48.0
137
+ version: '0'
138
138
  type: :development
139
139
  prerelease: false
140
140
  version_requirements: !ruby/object:Gem::Requirement
141
141
  requirements:
142
142
  - - ">="
143
143
  - !ruby/object:Gem::Version
144
- version: 0.48.0
144
+ version: '0'
145
145
  description: ''
146
146
  email:
147
147
  - ben@gimbo.net
@@ -182,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
182
  version: '0'
183
183
  requirements: []
184
184
  rubyforge_project:
185
- rubygems_version: 2.6.11
185
+ rubygems_version: 2.7.6
186
186
  signing_key:
187
187
  specification_version: 4
188
188
  summary: Allow ActiveRecord to share a connection to multiple databases on the same