refine-rails 2.14.0 → 2.14.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 521418c5dea81f6f37f39181a4685c08208efe9f649b32709224cbfa37e60d05
|
4
|
+
data.tar.gz: 0a48b500cc68e8a798e257d2e24c33679b6bd691c2e3b0cb4f984b5c85846a87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fc6d6ea27e7c7052e1d2d798770636f8b847b932c8d3b32d562a2adfa553919e53f78bc45e7e889258a4a65fea5ded9c2b377363b6a6163fc21ce5810cab708
|
7
|
+
data.tar.gz: 42df46f4edc1fe7093514369fc3cfc9b0a31a6e6800c04832fa7cc572981948c886038aedaf65e17d7b4129fa10a2ba9fad04ff7c44f4fe2acdf91bb410a7437
|
@@ -90,7 +90,7 @@ module Refine::Conditions
|
|
90
90
|
|
91
91
|
end # End of while loop
|
92
92
|
|
93
|
-
if condition_joins.any?
|
93
|
+
if condition_joins.any? && !condition_uses_different_database?(model_class, query.model)
|
94
94
|
add_pending_joins_if_needed(input: input, joins_array: condition_joins)
|
95
95
|
end
|
96
96
|
|
@@ -147,10 +147,11 @@ module Refine::Conditions
|
|
147
147
|
# the records matching the condition that will then be passed into the primary query.
|
148
148
|
def handle_flat_cross_database_condition(root_model:, input:, relation_class:, relation_table_being_queried:, inverse_clause:, key_1:, key_2:)
|
149
149
|
table = root_model.arel_table
|
150
|
-
relational_query = relation_class.select(key_2).arel
|
150
|
+
relational_query = relation_class.select(key_2).distinct.arel
|
151
151
|
node = apply(input, relation_table_being_queried, relation_class, inverse_clause)
|
152
152
|
relational_query = relational_query.where(node)
|
153
|
-
|
153
|
+
results = relation_class.find_by_sql(relational_query.to_sql)
|
154
|
+
array_of_ids = results.map { |result| result.send(key_2) }
|
154
155
|
if array_of_ids.length == 1
|
155
156
|
nodes = table[:"#{key_1}"].eq(array_of_ids.first)
|
156
157
|
else
|
data/lib/refine/rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refine-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.14.
|
4
|
+
version: 2.14.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Colleen Schnettler
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2025-
|
12
|
+
date: 2025-06-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|