ar-multidb 0.1.6 → 0.1.7
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.
- data/lib/multidb/balancer.rb +13 -1
- data/lib/multidb/version.rb +1 -1
- metadata +3 -3
data/lib/multidb/balancer.rb
CHANGED
@@ -23,6 +23,8 @@ module Multidb
|
|
23
23
|
@connection_pool.connection
|
24
24
|
end
|
25
25
|
end
|
26
|
+
|
27
|
+
attr_reader :connection_pool
|
26
28
|
end
|
27
29
|
|
28
30
|
class Balancer
|
@@ -52,7 +54,13 @@ module Multidb
|
|
52
54
|
end
|
53
55
|
end
|
54
56
|
end
|
55
|
-
|
57
|
+
|
58
|
+
def disconnect!
|
59
|
+
@candidates.each do |candidate|
|
60
|
+
candidate.connection_pool.disconnect!
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
56
64
|
def get(name, &block)
|
57
65
|
candidates = @candidates[name]
|
58
66
|
candidates ||= @fallback ? @candidates[:default] : []
|
@@ -95,6 +103,10 @@ module Multidb
|
|
95
103
|
def current_connection
|
96
104
|
Multidb.balancer.current_connection
|
97
105
|
end
|
106
|
+
|
107
|
+
def disconnect!
|
108
|
+
Multidb.balancer.disconnect!
|
109
|
+
end
|
98
110
|
end
|
99
111
|
|
100
112
|
end
|
data/lib/multidb/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ar-multidb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-06-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
84
|
version: '0'
|
85
85
|
requirements: []
|
86
86
|
rubyforge_project: ar-multidb
|
87
|
-
rubygems_version: 1.8.
|
87
|
+
rubygems_version: 1.8.23
|
88
88
|
signing_key:
|
89
89
|
specification_version: 3
|
90
90
|
summary: Multidb is an ActiveRecord extension for switching between multiple database
|