switchman 3.5.15 → 3.5.16

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: 26cfa40048169ee69fc8734d7daf962126d43d2cb7d47955fc944900a18d9b3a
4
- data.tar.gz: df6446066d7d8ff78f303e697f0527ed8e03f810a9af4495df3c2f5b77368b4a
3
+ metadata.gz: a27299a15c04348fc6a632a8c3c53b8c4fa541140b8befd07f63bc3544f01f50
4
+ data.tar.gz: d9a43fc82c874a87026c5d0b9467a45ba71df19e0c94166f22cc1aabe11b8e5f
5
5
  SHA512:
6
- metadata.gz: d246f4a181f8e3914f3b88b385ac7e607631d348735a65f39970584cac02720fc45da2f6761e209fc871b281b36c7c6fb587954cb54abf35124478314afd8a57
7
- data.tar.gz: da9134e8e47466ac3fb485cbd1b1ad5731fd7b9fcd25c3d97a6cbbdab2e71081c537023e67c98560d5f556e839f97f0360972e571bbe0fd022280b89cad1686f
6
+ metadata.gz: 2b47b69ec2830ed31204d0fe122d555b9f6623683469d6b35329cc1bfe1a18b6e5ec769985d792f64c72a696a4a16f4119407a9323b2560f4be575f52d5c09b9
7
+ data.tar.gz: 19bd4da4fa0ba4e4ec03c57858481f6dddd799b98bcd9e67e3870bbfb60c7cb69d44ba74781788c084069dc5bc17632f74b3c793d1964a8ef76122f2f78c144e
@@ -331,7 +331,15 @@ module Switchman
331
331
  primary_key_foreign_key_pairs = primary_key.zip(foreign_key)
332
332
  primary_key_foreign_key_pairs.each do |pk, fk|
333
333
  # Notable change: add relative_id_for here
334
- association_id = Shard.relative_id_for(record._read_attribute(pk), record.shard, shard)
334
+ association_id = if record.class.sharded_column?(pk)
335
+ Shard.relative_id_for(
336
+ record._read_attribute(pk),
337
+ record.shard,
338
+ shard
339
+ )
340
+ else
341
+ record._read_attribute(pk)
342
+ end
335
343
  self[fk] = association_id unless self[fk] == association_id
336
344
  end
337
345
  association.loaded!
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Switchman
4
- VERSION = "3.5.15"
4
+ VERSION = "3.5.16"
5
5
  end
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.5.15
4
+ version: 3.5.16
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: 2023-10-16 00:00:00.000000000 Z
13
+ date: 2023-10-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord