active_record_proxy_adapters 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
  SHA256:
3
- metadata.gz: 70b1c4f2efd94125b178e043fa1162ab6d8d8edb7a9041eb10b8244c606b3c59
4
- data.tar.gz: fb74c76ed0dc0865c9756c3188a92dd248ce58ef4832811704c15a59b728991e
3
+ metadata.gz: 194bba4baff1556a91940f5a5860f30313594655fe81928451ae4970f4f03f35
4
+ data.tar.gz: 1f8eaa86a73aab8ceded3beab0ee6a64dc099754dd3c4fad1ce380d5b511af6e
5
5
  SHA512:
6
- metadata.gz: 3730cca00342dd7f44944305bfdd53f158da2bc8d09b39883645a2b1a581297904dce121c10de5bc351e30b999b1bcd59457bd3309280074fb36d716a22bdcae
7
- data.tar.gz: 07d42f0c57bdd203a260a7d55010159318db260f95ed5483049e8a6ac771908df7696d05692a3043f0a54d77f4e2623c6aa08b7ddda2db5a79e634224db78b12
6
+ metadata.gz: 95e131acbfc3b48f1bcf475ebde62157978c6f6c29a0f8d616ba30bbc4eac03b866a404357314abff3fd826b1086b68ca782864512f090d77cb13e48f4f02f1b
7
+ data.tar.gz: '08bbf033512800954cc3ff0bd94b035d168a39ed8c790abb670b01238e438dfe431cf233c2d7e816ec28003f86c588227cc4a099eee0d9e17a922604cd6ef691'
@@ -70,9 +70,18 @@ module ActiveRecordProxyAdapters
70
70
  end
71
71
 
72
72
  def replica_pool
73
+ # use default handler if the connection pool for specific class is not found
74
+ specific_replica_pool || default_replica_pool
75
+ end
76
+
77
+ def specific_replica_pool
73
78
  connection_handler.retrieve_connection_pool(connection_class.name, role: reading_role)
74
79
  end
75
80
 
81
+ def default_replica_pool
82
+ connection_handler.retrieve_connection_pool(ActiveRecord::Base.name, role: reading_role)
83
+ end
84
+
76
85
  def connection_class
77
86
  active_record_context.connection_class_for(primary_connection)
78
87
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveRecordProxyAdapters
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record_proxy_adapters
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
  - Matt Cruz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-12-24 00:00:00.000000000 Z
11
+ date: 2025-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord