active_record_shards 5.4.1 → 5.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_record_shards/connection_switcher.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9e4c9f26a03dde94772c0888e49e3af56d68ffc4576fff3123a8dd50a73cce7
|
4
|
+
data.tar.gz: d4ea926bf565928ac2873e02b08b481cf731d3d62483482de450137886505d4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 699945070cfc1dde026841e71489a1e3d9e743cb4b49ff8e9a5f0849c1f50f3a55dab9833614377b8a998b8b181755c0efd2d090d3acd1d0f180c7dffee69c03
|
7
|
+
data.tar.gz: 6c1d7c1eb206352102e9d13b2f045e4e9cbd7262f8fe6baab0218ad9273e0ecab21442900730d8b1b07754b65e15d07f7341415f495930265ff892e455eb73c7
|
@@ -24,6 +24,9 @@ module ActiveRecordShards
|
|
24
24
|
|
25
25
|
base.singleton_class.send(:alias_method, :table_exists_without_default_shard?, :table_exists?)
|
26
26
|
base.singleton_class.send(:alias_method, :table_exists?, :table_exists_with_default_shard?)
|
27
|
+
|
28
|
+
base.singleton_class.send(:alias_method, :reset_primary_key_without_default_shard, :reset_primary_key)
|
29
|
+
base.singleton_class.send(:alias_method, :reset_primary_key, :reset_primary_key_with_default_shard)
|
27
30
|
end
|
28
31
|
|
29
32
|
def on_primary_db(&block)
|
@@ -150,6 +153,10 @@ module ActiveRecordShards
|
|
150
153
|
config_for_env[SHARD_NAMES_CONFIG_KEY] || []
|
151
154
|
end
|
152
155
|
|
156
|
+
def reset_primary_key_with_default_shard
|
157
|
+
with_default_shard { reset_primary_key_without_default_shard }
|
158
|
+
end
|
159
|
+
|
153
160
|
private
|
154
161
|
|
155
162
|
def config_for_env
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_record_shards
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Quorning
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2023-08-
|
16
|
+
date: 2023-08-26 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: activerecord
|