switch_point 0.4.3 → 0.4.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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/switch_point/connection.rb +2 -2
- data/lib/switch_point/proxy.rb +4 -4
- data/lib/switch_point/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6b1805e5054f11a52d44b88cd368c7d818d5d68
|
4
|
+
data.tar.gz: b4f1be476532072424bfa41ce5222248c313975c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7a172fbd91894e792564c1116e596ae918c0c33f42ce81c11e0c19650684faf2ccf27f096a35e65b3fcc964dc6d0e0945d625a3c22da251e8dd27612eb2c5d4
|
7
|
+
data.tar.gz: bfad8456783ebfa78e92a06af283adf7f0f2168dcf5dbba049e2c2db47ea1b4cd97b68e61ff56916f36a96391d889b94433afb5c4f8c08f236c57ce88ca6ad17
|
data/CHANGELOG.md
CHANGED
@@ -20,7 +20,7 @@ module SwitchPoint
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def self.handle_base_connection(conn, parent_method, *args, &block)
|
23
|
-
switch_points = conn.pool.
|
23
|
+
switch_points = conn.pool.spec.config[:switch_points]
|
24
24
|
if switch_points
|
25
25
|
switch_points.each do |switch_point|
|
26
26
|
proxy = ProxyRepository.find(switch_point[:name])
|
@@ -34,7 +34,7 @@ module SwitchPoint
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def self.handle_generated_connection(conn, parent_method, method_name, *args, &block)
|
37
|
-
switch_point = conn.pool.
|
37
|
+
switch_point = conn.pool.spec.config[:switch_point]
|
38
38
|
if switch_point
|
39
39
|
proxy = ProxyRepository.find(switch_point[:name])
|
40
40
|
case switch_point[:mode]
|
data/lib/switch_point/proxy.rb
CHANGED
@@ -36,13 +36,13 @@ module SwitchPoint
|
|
36
36
|
if mode != :writable
|
37
37
|
raise RuntimeError.new("ActiveRecord::Base's switch_points must be writable, but #{name} is #{mode}")
|
38
38
|
end
|
39
|
-
switch_points = pool.
|
39
|
+
switch_points = pool.spec.config[:switch_points] || []
|
40
40
|
switch_points << switch_point
|
41
|
-
pool.
|
42
|
-
elsif pool.
|
41
|
+
pool.spec.config[:switch_points] = switch_points
|
42
|
+
elsif pool.spec.config.has_key?(:switch_point)
|
43
43
|
# Only :writable is specified
|
44
44
|
else
|
45
|
-
pool.
|
45
|
+
pool.spec.config[:switch_point] = switch_point
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
data/lib/switch_point/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: switch_point
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kohei Suzuki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: appraisal
|