switchman 3.6.0 → 3.6.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7011fb3c1b2fdf36652a28d0a7f912e507068a7e7a725b041c24502fbf5d6aa
|
4
|
+
data.tar.gz: 71dffe2e2d7634032d0e6a7a6cf72d8be149d27ea63c532d0debe39f43f58e9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f0274a7d8f60ce1914747073a238411f5583b41daa08d1590db7795b0d2f877a54e1608942103ecb8c3c1d4e6adb8865be22adf4be86dc1643c75db1f2f60af
|
7
|
+
data.tar.gz: ecff381064d9c71e014cdc1739b09b742ec3c3a134f48b547aa410aedb5dd0e8e2ef22c57a132e705d69115dbeefed24984b7cacdaf33c7a452373cd0f370407
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Switchman
|
4
|
+
module ActiveRecord
|
5
|
+
module PendingMigrationConnection
|
6
|
+
module ClassMethods
|
7
|
+
def current_role
|
8
|
+
::ActiveRecord::Base.current_role
|
9
|
+
end
|
10
|
+
|
11
|
+
def current_switchman_shard
|
12
|
+
::ActiveRecord::Base.current_switchman_shard
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -44,6 +44,12 @@ module Switchman
|
|
44
44
|
primary_shard.activate(klass.connection_class_for_self) { super }
|
45
45
|
end
|
46
46
|
|
47
|
+
if ::Rails.version > "7.1.2"
|
48
|
+
def transaction(...)
|
49
|
+
primary_shard.activate(klass.connection_class_for_self) { super }
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
47
53
|
def explain
|
48
54
|
activate { |relation| relation.call_super(:explain, Relation) }
|
49
55
|
end
|
data/lib/switchman/engine.rb
CHANGED
@@ -78,6 +78,11 @@ module Switchman
|
|
78
78
|
::ActiveRecord::MigrationContext.prepend(ActiveRecord::MigrationContext)
|
79
79
|
::ActiveRecord::Migrator.prepend(ActiveRecord::Migrator)
|
80
80
|
|
81
|
+
if ::Rails.version > "7.1.3"
|
82
|
+
::ActiveRecord::PendingMigrationConnection.singleton_class
|
83
|
+
.include(ActiveRecord::PendingMigrationConnection::ClassMethods)
|
84
|
+
end
|
85
|
+
|
81
86
|
::ActiveRecord::Reflection::AbstractReflection.include(ActiveRecord::Reflection::AbstractReflection)
|
82
87
|
::ActiveRecord::Reflection::AssociationReflection.prepend(ActiveRecord::Reflection::AssociationScopeCache)
|
83
88
|
::ActiveRecord::Reflection::ThroughReflection.prepend(ActiveRecord::Reflection::AssociationScopeCache)
|
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: 3.6.
|
4
|
+
version: 3.6.2
|
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: 2024-03-
|
13
|
+
date: 2024-03-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|
@@ -249,6 +249,7 @@ files:
|
|
249
249
|
- lib/switchman/active_record/log_subscriber.rb
|
250
250
|
- lib/switchman/active_record/migration.rb
|
251
251
|
- lib/switchman/active_record/model_schema.rb
|
252
|
+
- lib/switchman/active_record/pending_migration_connection.rb
|
252
253
|
- lib/switchman/active_record/persistence.rb
|
253
254
|
- lib/switchman/active_record/postgresql_adapter.rb
|
254
255
|
- lib/switchman/active_record/predicate_builder.rb
|