fresh_connection 0.1.3 → 0.1.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: f83d1ba0780db658b9d3e9879476a4992b3f43ba
4
- data.tar.gz: f25542e364f014b4fae17820715f91bb24ce4e1c
3
+ metadata.gz: d0939ebfd084f8d11d439b33bf518efeafb55024
4
+ data.tar.gz: 225f106ccf4acfabdd53d6285b57f346860a046b
5
5
  SHA512:
6
- metadata.gz: 7351305422d63add314a3a3a2aea341557d9338fae72af84c252e311cb7f5f3a0b2c669ec79d2230889e373acf094f8a3670006c2093a6c17027abd4af5acc34
7
- data.tar.gz: 8a19c6258fcff2798143c6a807e538980f9dc3afa73b689f9b028dc2cdb126acdab0f6deb2b7af72e701bf24933664a725944c807a2f5fa2bcb78fcbd291687c
6
+ metadata.gz: 8ee3bf8d6c0ac45ae16a5ae3326b03c931f4d0803f174b4eb96eb1183873d26f9af3212f194618d98f318602d77ddf6ccc5e10f010775763d8f0171b7ea413f2
7
+ data.tar.gz: 88c1456fd03b69733edd6caf910ff58b93b974bf93ad18fc10cbcb03dc2c0a741f05624e6d70cd2c239e9ae2a4b34ddc523eae92fd1d8b08820cf509da7c5b6f
@@ -1,5 +1,12 @@
1
1
  module ActiveRecord
2
2
  class Relation
3
+ def calculate_with_slave_connection(operation, column_name, options = {})
4
+ FreshConnection::SlaveConnection.manage_access(@klass, (go_slave? && options[:readonly] != false)) do
5
+ calculate_without_slave_connection(operation, column_name, options)
6
+ end
7
+ end
8
+ alias_method_chain :calculate, :slave_connection
9
+
3
10
  private
4
11
 
5
12
  def exec_queries_with_slave_connection
@@ -1,4 +1,4 @@
1
1
  module FreshConnection
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fresh_connection
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tsukasa OISHI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-11 00:00:00.000000000 Z
11
+ date: 2013-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord