wye 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/wye/active_record/connection_handler.rb +5 -1
- data/lib/wye/version.rb +1 -1
- metadata +1 -1
@@ -15,13 +15,17 @@ module Wye
|
|
15
15
|
@switch = Switch.new(::ActiveRecord::Base)
|
16
16
|
end
|
17
17
|
|
18
|
+
def alternates
|
19
|
+
@class_to_alternate_pools.map { |(klass,atp)| atp.map(&:first) }.flatten.uniq
|
20
|
+
end
|
21
|
+
|
18
22
|
def establish_connection(name, spec)
|
19
23
|
super.tap do
|
20
24
|
@class_to_alternate_pools[name] ||= {}
|
21
25
|
|
22
26
|
alternate_specs(spec).each do |alternate,spec|
|
23
27
|
@connection_pools[spec] ||= ::ActiveRecord::ConnectionAdapters::ConnectionPool.new(spec)
|
24
|
-
@class_to_alternate_pools[name][alternate] = @connection_pools[spec]
|
28
|
+
@class_to_alternate_pools[name][alternate.to_sym] = @connection_pools[spec]
|
25
29
|
end
|
26
30
|
end
|
27
31
|
end
|
data/lib/wye/version.rb
CHANGED