switchman 3.5.5 → 3.5.7

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: a1565732de1d00cf5e04683eb1d14da6e7a6407aab14dc036ff85b400de8fded
4
- data.tar.gz: 6b47f28566414d1bacb7089d5a836c72246ddcdd864f0635950823a80418b09e
3
+ metadata.gz: 615b594dc138a3a78ce121713f4bdd4f80c6a681d53c40d530bf41b5e3b0c131
4
+ data.tar.gz: 19c663ef30ce99c2ad900b170d5c0b94b1cc92d29207de7d50bb68eeaafab83c
5
5
  SHA512:
6
- metadata.gz: 41352fccd2fe5346655e06820b8d0afe5f560480b3978f3bbca500dbc62e198a38b3fda435bef7d6d0836887343970a0a35b4fc866132e8331f7dcbfd6ba6cc8
7
- data.tar.gz: 3d3fb827b20c7495b6bb70eaa054ed0a972a1ad823861abe7a00b5cf77d80cbbc58e3f9077d02acd3847e2b59ea24501abd525b7116d794dc626fded8430537b
6
+ metadata.gz: 18cc255715318ec631fd865db4eb56160cbccbcea43bae8610d9d1837d016aed4365d943025b4fbf9a42cad747b1e2a018bb2a2caf310e1cd53c97b0d2e9f8f1
7
+ data.tar.gz: 6d08cdb0b895d35194b10114e7ce04bdd76268a85c54a6ad1a5f5ef67cc2d9a9ebddc0c77528b255a962cdc3c25501d025de7c454c5f2d6385f5a019a210fbed
@@ -11,11 +11,11 @@ module Switchman
11
11
  end
12
12
  end
13
13
 
14
- module AssociationQueryValue
14
+ module PolymorphicArrayValue
15
15
  def convert_to_id(value)
16
16
  case value
17
17
  when ::ActiveRecord::Base
18
- value.id
18
+ value.send(primary_key(value))
19
19
  else
20
20
  super
21
21
  end
@@ -87,11 +87,8 @@ module Switchman
87
87
  ::ActiveRecord::Relation.include(ActiveRecord::SpawnMethods)
88
88
  ::ActiveRecord::Relation.include(CallSuper)
89
89
 
90
- ::ActiveRecord::PredicateBuilder::AssociationQueryValue.prepend(
91
- ActiveRecord::PredicateBuilder::AssociationQueryValue
92
- )
93
90
  ::ActiveRecord::PredicateBuilder::PolymorphicArrayValue.prepend(
94
- ActiveRecord::PredicateBuilder::AssociationQueryValue
91
+ ActiveRecord::PredicateBuilder::PolymorphicArrayValue
95
92
  )
96
93
 
97
94
  ::ActiveRecord::Tasks::DatabaseTasks.singleton_class.prepend(ActiveRecord::Tasks::DatabaseTasks)
@@ -13,6 +13,8 @@ module Switchman
13
13
  Thread.current[:switchman_error_handler] = true
14
14
 
15
15
  @active_shards ||= Shard.active_shards
16
+ rescue ThreadError # e.g. `require': can't be called from trap context (ThreadError)
17
+ # intentionally empty
16
18
  ensure
17
19
  Thread.current[:switchman_error_handler] = nil
18
20
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Switchman
4
- VERSION = "3.5.5"
4
+ VERSION = "3.5.7"
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.5
4
+ version: 3.5.7
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-07-03 00:00:00.000000000 Z
13
+ date: 2023-07-31 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord