switchman 2.0.12 → 2.0.13
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de9d4ea9f0368bf1bfe15fdb8dd6bef040a8ec107aed386eaa81f8fa444513df
|
4
|
+
data.tar.gz: 71b7905b40d59a4767576552c8f5d16a2b3bdaec6d910f81f18d803a9c916256
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bac07aa4f15521f123a1d95f676448d649c71eddd86fdfbbb57504f59d0c71f9ce69618aa7d1e25e93fdc278708cb2a7385d111417f23a8fc0eb1e9b6f6eefb3
|
7
|
+
data.tar.gz: 1c091615da88fe2f54de51de1e740336007fd13d66d0cac0b977d0e2770a6dfacd6a85bd12b689a0c610b1de5daeab4512743f0c50199e0f610806cc2f4dd629
|
@@ -246,6 +246,18 @@ module Switchman
|
|
246
246
|
binds: nil,
|
247
247
|
dup_binds_on_mutation: false)
|
248
248
|
result = predicates.map do |predicate|
|
249
|
+
if ::Rails.version >= '5.2' && predicate.is_a?(::Arel::Nodes::And)
|
250
|
+
new_predicates, _binds = transpose_predicates(predicate.children, source_shard, target_shard,
|
251
|
+
remove_nonlocal_primary_keys,
|
252
|
+
binds: binds,
|
253
|
+
dup_binds_on_mutation: dup_binds_on_mutation)
|
254
|
+
next (if new_predicates == predicate.children
|
255
|
+
predicate
|
256
|
+
else
|
257
|
+
::Arel::Nodes::And.new(new_predicates)
|
258
|
+
end)
|
259
|
+
end
|
260
|
+
|
249
261
|
next predicate unless predicate.is_a?(::Arel::Nodes::Binary)
|
250
262
|
next predicate unless predicate.left.is_a?(::Arel::Attributes::Attribute)
|
251
263
|
relation, column = relation_and_column(predicate.left)
|
data/lib/switchman/engine.rb
CHANGED
@@ -142,6 +142,7 @@ module Switchman
|
|
142
142
|
|
143
143
|
::ActiveRecord::Relation::WhereClauseFactory.prepend(ActiveRecord::WhereClauseFactory)
|
144
144
|
::ActiveRecord::PredicateBuilder::AssociationQueryValue.prepend(ActiveRecord::PredicateBuilder::AssociationQueryValue)
|
145
|
+
::ActiveRecord::PredicateBuilder::PolymorphicArrayValue.prepend(ActiveRecord::PredicateBuilder::AssociationQueryValue)
|
145
146
|
::ActiveRecord::TypeCaster::Map.include(ActiveRecord::TypeCaster::Map)
|
146
147
|
::ActiveRecord::TypeCaster::Connection.include(ActiveRecord::TypeCaster::Connection)
|
147
148
|
|
data/lib/switchman/version.rb
CHANGED