switchman 1.5.19 → 1.5.20
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f93ffdf39f2476bbca446bd460d92929f405fd20
|
4
|
+
data.tar.gz: b9474a6f15ce63eca588224f8b079481628b5cea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69ab7d6917a101adbd9b7d2d52c86da2c1c24d3acbc44410aab2068ec9e24ad45bae9e4fcc89db8d4b9d6d67107e3ccfadbe4adfdfefe4a70409c66dcc6233c7
|
7
|
+
data.tar.gz: 4144225d20c804a42d22e952afa493ebaafc537a7dc72a9836d6026940a375222ea534d6513538a03ae51eac2b1c8e4ace3cb7ae9bbcac8c7252fdc06673b083
|
@@ -451,7 +451,8 @@ module Switchman
|
|
451
451
|
|
452
452
|
# takes an id-ish, and returns a local id and the shard it's
|
453
453
|
# local to. [nil, nil] if it can't be interpreted. [id, nil]
|
454
|
-
# if it's already a local ID
|
454
|
+
# if it's already a local ID. [nil, nil] if it's a well formed
|
455
|
+
# id, but the shard it refers to does not exist
|
455
456
|
NIL_NIL_ID = [nil, nil].freeze
|
456
457
|
def local_id_for(any_id)
|
457
458
|
id = integral_id_for(any_id)
|
@@ -466,10 +467,13 @@ module Switchman
|
|
466
467
|
end
|
467
468
|
|
468
469
|
# takes an id-ish, and returns an integral id relative to
|
469
|
-
# target_shard. returns
|
470
|
+
# target_shard. returns nil if it can't be interpreted,
|
471
|
+
# or the integral version of the id if it refers to a shard
|
472
|
+
# that does not exist
|
470
473
|
def relative_id_for(any_id, source_shard, target_shard)
|
471
|
-
|
472
|
-
|
474
|
+
integral_id = integral_id_for(any_id)
|
475
|
+
local_id, shard = local_id_for(integral_id)
|
476
|
+
return integral_id unless local_id
|
473
477
|
shard ||= source_shard
|
474
478
|
return local_id if shard == target_shard
|
475
479
|
shard.global_id_for(local_id)
|
@@ -295,6 +295,7 @@ module Switchman
|
|
295
295
|
local_ids = []
|
296
296
|
predicate.right.each do |value|
|
297
297
|
local_id = Shard.relative_id_for(value, current_source_shard, target_shard)
|
298
|
+
next unless local_id
|
298
299
|
unless remove && local_id > Shard::IDS_PER_SHARD
|
299
300
|
if ::Rails.version > "4.2" && value.is_a?(::Arel::Nodes::Casted)
|
300
301
|
if local_id == value.val
|
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: 1.5.
|
4
|
+
version: 1.5.20
|
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: 2016-
|
13
|
+
date: 2016-09-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: railties
|