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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a320c844b75f762282d2afd916122103f94df703
|
4
|
+
data.tar.gz: b42c38fd655c1a9d6d1f7c9a3cfba65110f02b0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|