active_replicas 0.2.1 → 0.2.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee4ea643ba17993e611be47f8a55c50b56122175
|
4
|
+
data.tar.gz: 30b84268ea6143508e580ef1cc83ee3377c55c14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5774c2aa857dd453dab147bb6650fe85b446dadad95bbd7c89fdbb3cb0689e6f8ec4749decdba5bd0ab95f9cf6e6a756097f6fd4fc5caf190c437a9453741c60
|
7
|
+
data.tar.gz: 7d0a3d05bf52f7fad5da03af7507ef96399699ad19a956d68137159bbd72cd5700131384f615d07dea1438ecb9edf058b145cc487a343df6fbdbdd90e3b6fa19
|
@@ -20,7 +20,7 @@ module ActiveReplicas
|
|
20
20
|
if @is_primary
|
21
21
|
@connection.send method, *args, &block
|
22
22
|
else
|
23
|
-
if role == :primary
|
23
|
+
if role == :primary || @proxy.using_primary?
|
24
24
|
# Need to get a primary connection from the proxy pool.
|
25
25
|
@proxy.primary_connection.send method, *args, &block
|
26
26
|
else
|
@@ -113,6 +113,10 @@ module ActiveReplicas
|
|
113
113
|
@current_pool = previous_pool
|
114
114
|
end
|
115
115
|
|
116
|
+
def using_primary?
|
117
|
+
@primary_depth > 0
|
118
|
+
end
|
119
|
+
|
116
120
|
# Quick accessor to a primary connection.
|
117
121
|
#
|
118
122
|
# NOTE: If this is not already in a `with_primary` block then calling this
|
@@ -29,7 +29,7 @@ module ActiveReplicas
|
|
29
29
|
:quote_table_name_for_assignment, :raw_connection, :reconnect!,
|
30
30
|
:sanitize_limit, :schema_cache, :select, :select_all, :select_one,
|
31
31
|
:select_rows, :select_value, :select_values, :substitute_at, :to_sql,
|
32
|
-
:type_cast, :uncached, :valid_type?, :verify
|
32
|
+
:type_cast, :uncached, :valid_type?, :verify!, :visitor
|
33
33
|
]
|
34
34
|
).uniq
|
35
35
|
|
@@ -67,11 +67,11 @@ module ActiveReplicas
|
|
67
67
|
SUPPORTS_METHODS +
|
68
68
|
[
|
69
69
|
:add_transaction_record, :assume_migrated_upto_version,
|
70
|
-
:begin_db_transaction, :commit_db_transaction,
|
70
|
+
:begin_transaction, :begin_db_transaction, :commit_db_transaction,
|
71
71
|
:disable_referential_integrity, :foreign_keys, :indexes,
|
72
72
|
:native_database_types, :prefetch_primary_key?, :primary_key,
|
73
|
-
:
|
74
|
-
:transaction_state
|
73
|
+
:rollback_transaction, :rollback_db_transaction, :tables,
|
74
|
+
:table_exists?, :transaction, :transaction_state
|
75
75
|
]
|
76
76
|
).uniq
|
77
77
|
|