active_record_shards 5.4.1 → 5.5.0

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: 0dad44339b071fbea35fbf5298c8a1ded5f78ecabb97a4e48da974c1191b94cd
4
- data.tar.gz: ddfe5d8a76e1007ea68a85d7cd0bad6b8c0334752136a8a72574d2d776fb1de5
3
+ metadata.gz: f9e4c9f26a03dde94772c0888e49e3af56d68ffc4576fff3123a8dd50a73cce7
4
+ data.tar.gz: d4ea926bf565928ac2873e02b08b481cf731d3d62483482de450137886505d4d
5
5
  SHA512:
6
- metadata.gz: 751f5301b1a0fac6834ed5571b992e71ae0e6e18c4ac9cd94acd64c56650fe08961d50350bed19b0db23d9bdac98d18b8ba7cf46f958278dcc882418b3408257
7
- data.tar.gz: 4866f71bd64c603cf997638607fd93100c264c0ac4b910d7ee5e20237f53cd06756093f2cf27712453d536e52fc9898b688466fd7c080d893db5494480fcf3e8
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.1
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-04 00:00:00.000000000 Z
16
+ date: 2023-08-26 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: activerecord