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: d7caa90c319bc8e2e3f1c4d2e279759e5da28d9b
4
- data.tar.gz: 8cf3ca24021943f556315f35e6bb1ccdb543de6e
3
+ metadata.gz: ee4ea643ba17993e611be47f8a55c50b56122175
4
+ data.tar.gz: 30b84268ea6143508e580ef1cc83ee3377c55c14
5
5
  SHA512:
6
- metadata.gz: c7731ce4d1783326d548601f6b21cf0867eed51b4ca64cf5d91c730aa8ddfa38f476a845b05c8b1f061c18c8b8c2675affe04316daf9f30a6a5c5134273080ce
7
- data.tar.gz: 4afcf0738eedadcf8be6fc8df0ddd68b281524a2387b1e884f98e90bc225096eb45c5e8133029dbf20a0bbb642dde79603b51e67c88fe9c636bc68eca887191c
6
+ metadata.gz: 5774c2aa857dd453dab147bb6650fe85b446dadad95bbd7c89fdbb3cb0689e6f8ec4749decdba5bd0ab95f9cf6e6a756097f6fd4fc5caf190c437a9453741c60
7
+ data.tar.gz: 7d0a3d05bf52f7fad5da03af7507ef96399699ad19a956d68137159bbd72cd5700131384f615d07dea1438ecb9edf058b145cc487a343df6fbdbdd90e3b6fa19
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- active_replicas (0.2.1)
4
+ active_replicas (0.2.2)
5
5
  concurrent-ruby (~> 1.0)
6
6
 
7
7
  GEM
@@ -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
- :rollback_db_transaction, :tables, :table_exists?, :transaction,
74
- :transaction_state
73
+ :rollback_transaction, :rollback_db_transaction, :tables,
74
+ :table_exists?, :transaction, :transaction_state
75
75
  ]
76
76
  ).uniq
77
77
 
@@ -1,3 +1,3 @@
1
1
  module ActiveReplicas
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_replicas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dirk Gadsden