slave_pools 1.0.0.rc1 → 1.0.0.rc2

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: ca6c92616b9b71f41b9a8f0acf4487266dddc08e
4
- data.tar.gz: 353fe4fd321793f797ca765a6a1fbac2cd942485
3
+ metadata.gz: ada15436188b84a0fae0247b38aeac4ec0344649
4
+ data.tar.gz: 480836da042e92a4c86fc213a9b1033c3e628af7
5
5
  SHA512:
6
- metadata.gz: e8a36182804f50de04b2c049dd671244a1b6a90dc6ab53a0ba57df3898caf171da964af02c2871e19b2a1f673ba14560cb6e797e0b950ef463f228858524d606
7
- data.tar.gz: e22b49cd625efcbfc5baff7b7868f79494f0f9499d992fafc8cdccfba6580855a55c59023e0b18492db0e784dc24f32974b807b8f0d2dbdaecd3d33e37569ea8
6
+ metadata.gz: 16ec508961e20c2785b7c9851ffde2856c72f07220abc6a0364c175cac98ead0cbb6c972de9b1d87635636d8626774fab8e190fdaa8f762873955fdd2a251933
7
+ data.tar.gz: 855daf885ddb869034f642f15677e388475b1a220b1846d3a5ec6fa49570dc2ff22fe7d555043986288bfd183a1b044f989bdc8bb0870958affe13b400a9fbdc
@@ -2,14 +2,17 @@ module SlavePools
2
2
  module ActiveRecordExtensions
3
3
  def self.included(base)
4
4
  base.send :extend, ClassMethods
5
- base.cattr_accessor :connection_proxy
6
5
  end
7
6
 
8
7
  def reload(options = nil)
9
- self.connection_proxy.with_master { super }
8
+ self.class.connection_proxy.with_master { super }
10
9
  end
11
10
 
12
11
  module ClassMethods
12
+ def connection_proxy
13
+ SlavePools.proxy
14
+ end
15
+
13
16
  # Make sure transactions run on master
14
17
  # Even if they're initiated from ActiveRecord::Base
15
18
  # (which doesn't have our hijack).
@@ -1,3 +1,3 @@
1
1
  module SlavePools
2
- VERSION = "1.0.0.rc1"
2
+ VERSION = "1.0.0.rc2"
3
3
  end
data/lib/slave_pools.rb CHANGED
@@ -28,7 +28,6 @@ module SlavePools
28
28
  ConnectionProxy.generate_safe_delegations
29
29
 
30
30
  ActiveRecord::Base.send(:extend, SlavePools::Hijack)
31
- ActiveRecord::Base.connection_proxy = self.proxy
32
31
 
33
32
  log :info, "Proxy loaded with: #{pools.keys.join(', ')}"
34
33
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slave_pools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc1
4
+ version: 1.0.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Drabik
@@ -87,6 +87,9 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
+ - LICENSE
91
+ - README.md
92
+ - lib/slave_pools.rb
90
93
  - lib/slave_pools/active_record_extensions.rb
91
94
  - lib/slave_pools/config.rb
92
95
  - lib/slave_pools/connection_proxy.rb
@@ -97,9 +100,6 @@ files:
97
100
  - lib/slave_pools/pools.rb
98
101
  - lib/slave_pools/query_cache.rb
99
102
  - lib/slave_pools/version.rb
100
- - lib/slave_pools.rb
101
- - LICENSE
102
- - README.md
103
103
  - spec/config/test_model.rb
104
104
  - spec/connection_proxy_spec.rb
105
105
  - spec/observer_extensions_spec.rb
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  version: '1.2'
128
128
  requirements: []
129
129
  rubyforge_project:
130
- rubygems_version: 2.1.11
130
+ rubygems_version: 2.2.0
131
131
  signing_key:
132
132
  specification_version: 4
133
133
  summary: Connection proxy for ActiveRecord for master / replica setups.