switch_point 0.4.3 → 0.4.4

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
2
  SHA1:
3
- metadata.gz: 7e586669d11f096afeeb93a78957547b262583dd
4
- data.tar.gz: 72070196c4ca9a4ace102c2e70e24924eac98859
3
+ metadata.gz: c6b1805e5054f11a52d44b88cd368c7d818d5d68
4
+ data.tar.gz: b4f1be476532072424bfa41ce5222248c313975c
5
5
  SHA512:
6
- metadata.gz: bcd62b44be847b7466f31083b10eb9662061e27f33855d75bc5867ba5c12b43ac6fd57e2fb539e5a3234755540e397b9c5a3c1b30a036cbb09b60ef63d6ed282
7
- data.tar.gz: 56249e61ef7b33a5b170680a1fd9350e8fdc42a54d051790e2c6bbb53b2056661e93c9fed7a66d9cdc1a9b4b49ef6926073f12d5dc2ba7764e27a8fbbac4ef2c
6
+ metadata.gz: c7a172fbd91894e792564c1116e596ae918c0c33f42ce81c11e0c19650684faf2ccf27f096a35e65b3fcc964dc6d0e0945d625a3c22da251e8dd27612eb2c5d4
7
+ data.tar.gz: bfad8456783ebfa78e92a06af283adf7f0f2168dcf5dbba049e2c2db47ea1b4cd97b68e61ff56916f36a96391d889b94433afb5c4f8c08f236c57ce88ca6ad17
@@ -1,3 +1,7 @@
1
+ ## 0.4.4 (2014-07-14)
2
+ - Memorize switch_point config to ConnectionSpecification#config instead of ConnectionPool
3
+ - To support multi-threaded environment since Rails 4.0.
4
+
1
5
  ## 0.4.3 (2014-06-24)
2
6
  - Add Model.transaction_with method (#2, @ryopeko)
3
7
 
@@ -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.instance_variable_get(:@switch_points)
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.instance_variable_get(:@switch_point)
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]
@@ -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.instance_variable_get(:@switch_points) || []
39
+ switch_points = pool.spec.config[:switch_points] || []
40
40
  switch_points << switch_point
41
- pool.instance_variable_set(:@switch_points, switch_points)
42
- elsif pool.instance_variable_defined?(:@switch_point)
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.instance_variable_set(:@switch_point, switch_point)
45
+ pool.spec.config[:switch_point] = switch_point
46
46
  end
47
47
  end
48
48
 
@@ -1,3 +1,3 @@
1
1
  module SwitchPoint
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.4"
3
3
  end
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.3
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-06-24 00:00:00.000000000 Z
11
+ date: 2014-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appraisal