switchman 4.2.0 → 4.2.1
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3de3ef5f2ede9dffce78d116f3e5a8bef26ff3b9430057a85020c09838716c8e
|
4
|
+
data.tar.gz: e2fa7136ae05fa728a543734a914b792ed052ee27ccc784d426a5be8fea9c4ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e36f968755b4e866200e78dba86406b821822eaec1ce21409d200647363bed80909a4344c8e4872af346c76bb5b8140ce82537dd57c559823f14c527a9fd6a5d
|
7
|
+
data.tar.gz: ae78558b30d154e80da947897539e99e9f1fdb8a5311444e7d40066113807d3ecfd55669e0962c293c3bb45c16e7ce96414c679f44984325c8eebdf09005fa96
|
@@ -19,10 +19,18 @@ module Switchman
|
|
19
19
|
|
20
20
|
def initialize(*args)
|
21
21
|
super
|
22
|
-
|
22
|
+
|
23
|
+
@instrumenter = Switchman::ShardedInstrumenter.new(@instrumenter, self) if ::Rails.version < "8.0"
|
24
|
+
|
23
25
|
@last_query_at = Time.now
|
24
26
|
end
|
25
27
|
|
28
|
+
if ::Rails.version >= "8.0"
|
29
|
+
def instrumenter # :nodoc:
|
30
|
+
@instrumenter ||= Switchman::ShardedInstrumenter.new(::ActiveSupport::Notifications.instrumenter, self)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
26
34
|
def quote_local_table_name(name)
|
27
35
|
quote_table_name(name)
|
28
36
|
end
|
@@ -13,10 +13,16 @@ module Switchman
|
|
13
13
|
# when we might be doing a query while defining attribute methods,
|
14
14
|
# so just avoid logging then
|
15
15
|
if shard.is_a?(Shard) && Shard.instance_variable_get(:@attribute_methods_generated)
|
16
|
+
env = if ::Rails.version < "8.0"
|
17
|
+
@shard_host.pool.connection_class&.current_role
|
18
|
+
else
|
19
|
+
@shard_host.pool.connection_descriptor.name.constantize&.current_role
|
20
|
+
end
|
21
|
+
|
16
22
|
payload[:shard] = {
|
17
23
|
database_server_id: shard.database_server.id,
|
18
24
|
id: shard.id,
|
19
|
-
env:
|
25
|
+
env: env
|
20
26
|
}
|
21
27
|
end
|
22
28
|
super
|
data/lib/switchman/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: switchman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.
|
4
|
+
version: 4.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cody Cutrer
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2025-
|
13
|
+
date: 2025-09-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|