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: fcaec6a16a7f77268e6af7578a103cd32e51581ff47620a807c8041c41a30f9a
4
- data.tar.gz: 61346cac343a3e2f434577d68620a62c40ea78d8f43626ba5a29d603901d27c1
3
+ metadata.gz: 521418c5dea81f6f37f39181a4685c08208efe9f649b32709224cbfa37e60d05
4
+ data.tar.gz: 0a48b500cc68e8a798e257d2e24c33679b6bd691c2e3b0cb4f984b5c85846a87
5
5
  SHA512:
6
- metadata.gz: fb8afe7f33ae5d300427183fd4d3735bb357666fc01629cf8e6b487bb3c3ea99eb4e257da928612f4276b9b213a536086b53a5845a6323e18d762a7c5206d820
7
- data.tar.gz: d46eb10e4469431bf3fe4ec603755a84064da55127e4256cb6d2eb5a716730d7f04b603a99cb4b8a854fd5d4a4da18ef72b8b727fe3f9ea80db4761e33017db9
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
- array_of_ids = relation_class.connection.exec_query(relational_query.to_sql).rows.flatten
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
@@ -1,5 +1,5 @@
1
1
  module Refine
2
2
  module Rails
3
- VERSION = "2.14.0"
3
+ VERSION = "2.14.1"
4
4
  end
5
5
  end
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.0
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-05-06 00:00:00.000000000 Z
12
+ date: 2025-06-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails