fresh_connection 0.1.4 → 0.1.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d0939ebfd084f8d11d439b33bf518efeafb55024
4
- data.tar.gz: 225f106ccf4acfabdd53d6285b57f346860a046b
3
+ metadata.gz: a320c844b75f762282d2afd916122103f94df703
4
+ data.tar.gz: b42c38fd655c1a9d6d1f7c9a3cfba65110f02b0c
5
5
  SHA512:
6
- metadata.gz: 8ee3bf8d6c0ac45ae16a5ae3326b03c931f4d0803f174b4eb96eb1183873d26f9af3212f194618d98f318602d77ddf6ccc5e10f010775763d8f0171b7ea413f2
7
- data.tar.gz: 88c1456fd03b69733edd6caf910ff58b93b974bf93ad18fc10cbcb03dc2c0a741f05624e6d70cd2c239e9ae2a4b34ddc523eae92fd1d8b08820cf509da7c5b6f
6
+ metadata.gz: 3f8b2b1ba3516d178588aef9a5a3ff23ca9d32335c0fca590c8161f6fc5a02dcf8dd74a74ced6de430e60227af7c4b6b3e7d9195055e40afe6fdab9fc43b6974
7
+ data.tar.gz: fd9c2b4d2002f70e8289105ea7fc3e3cffda95ce9143f5d834d1b5a6c3aaa22b02e28e40ef3025c2c22d33984973c21fef830331327467f95d7338fa911301b7
@@ -1,12 +1,5 @@
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
-
10
3
  private
11
4
 
12
5
  def exec_queries_with_slave_connection
@@ -28,4 +21,13 @@ module ActiveRecord
28
21
  end
29
22
  end
30
23
  end
24
+
25
+ module Calculations
26
+ def calculate_with_slave_connection(operation, column_name, options = {})
27
+ FreshConnection::SlaveConnection.manage_access(@klass, (go_slave? && options[:readonly] != false)) do
28
+ calculate_without_slave_connection(operation, column_name, options)
29
+ end
30
+ end
31
+ alias_method_chain :calculate, :slave_connection
32
+ end
31
33
  end
@@ -1,4 +1,4 @@
1
1
  module FreshConnection
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fresh_connection
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tsukasa OISHI