refine-rails 2.13.0 → 2.13.2

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: f89d05537180f0c65bab1c517d5a3063ff92339649ee1900285075cc24e3573a
4
- data.tar.gz: 118ac4a2cb4616844d555bb13f1fe09cdb5bc4b17101f39cb0b2ed7278b335c4
3
+ metadata.gz: 67595ba20d0aeec9f9bae8d277b760b1928074c8a7946d92eda75a276855afd5
4
+ data.tar.gz: bb1917cfe855069d7e3c3df79c7ca8e12ba206b095a6e0db2263141ae405acb7
5
5
  SHA512:
6
- metadata.gz: bd219b511cb2d34007f96e84c5c2768b3547e4ef6b24e85ea4a4d69112f65a5583dfaeb1d04140f82a81ad6a60d2c4548fdb03ac60bb33c3d836bd6dac9320ea
7
- data.tar.gz: cfa3ec1d60a35524087f52a754af043e0eb880ba9717444808b5d6ef173bb0860cb674c45fbc6c756964c4a8f2c17509d1b315dbf52929b167acfbdcbf450c11
6
+ metadata.gz: 75a2b64a293f40776ffd07f2aa0f13e87e3e59443bd0d5e0d638adad5255adba96a6b5ec528bef723cbad9f5de2ad0f66080fb5b86883d6b04b87f55014dae68
7
+ data.tar.gz: 0c0880ad431be7bc549962cadf4bacb60d7d9f182e99789ac5c495053d0e5295bff697892af8f263cf2acbbd0bdd310b5df9e97b14dda26d67387e974af562d1
@@ -131,11 +131,24 @@ module Refine::Conditions
131
131
  child_foreign_key = instance.source_reflection.foreign_key
132
132
  relation_table_being_queried = through_reflection.klass.arel_table
133
133
  relation_class = through_reflection.klass
134
- subquery_path = through_reflection.klass.select(parent_foreign_key).arel
134
+ if(through_reflection.chain.count > 1)
135
+ # We need to shortcut the outer inner joins but allow the others to go as normal
136
+ parent_foreign_key = through_reflection.chain.last.foreign_key
137
+ parent_through_reflection = through_reflection.chain.last
138
+ join_sym = through_reflection.source_reflection_name
139
+ subquery_path = parent_through_reflection.klass.select(parent_foreign_key).joins(join_sym)
140
+ if(through_reflection.scope && through_reflection.scope.is_a?(Proc))
141
+ subquery_path = subquery_path.instance_exec(&through_reflection.scope)
142
+ end
143
+ subquery_path = subquery_path.arel
144
+ else
145
+ # Does not need any inner joins
146
+ subquery_path = through_reflection.klass.select(parent_foreign_key).arel
147
+ end
135
148
 
136
149
  node_to_apply = apply(input, relation_table_being_queried, relation_class, inverse_clause, child_foreign_key)
137
150
  else
138
- raise "with_through_id must be used with a has_many :through relationship"
151
+ raise Refine::Conditions::Errors::RelationshipError.new("with_through_id must be used with a has_many :through relationship")
139
152
  end
140
153
  else
141
154
  node_to_apply = apply(input, relation_table_being_queried, relation_class, inverse_clause)
@@ -5,6 +5,7 @@
5
5
  controller: "refine--turbo-stream-link",
6
6
  action: "refine--turbo-stream-link#visit",
7
7
  refine__typeahead_list_target: "listItem",
8
+ turbo_prefetch: false,
8
9
  list_item_value: condition.display,
9
10
  }
10
11
  if category && category.present?
@@ -4,7 +4,7 @@
4
4
  frame_id: dom_id(criterion) do
5
5
  %>
6
6
 
7
- <div class="refine--condition-pill-wrapper">
7
+ <div class="refine--condition-pill-wrapper" data-turbo-prefetch="false">
8
8
  <div class="refine--condition-pill">
9
9
  <%= link_to refine_advanced_inline_criterion_path(criterion.position, criterion.to_params), class: "refine--remove-condition", data: {turbo_method: :delete, controller: "refine--turbo-stream-link", action: "refine--turbo-stream-link#visit"} do %>
10
10
  <span class="material-icons-outlined refine--icon-sm">clear</span>
@@ -5,7 +5,7 @@
5
5
  %>
6
6
 
7
7
  <div class="refine--condition-pill-wrapper">
8
- <div class="refine--condition-pill">
8
+ <div class="refine--condition-pill" data-turbo-prefetch="false">
9
9
  <%= link_to refine_inline_criterion_path(criterion.position, criterion.to_params), class: "refine--remove-condition", data: {turbo_method: :delete, controller: "refine--turbo-stream-link", action: "refine--turbo-stream-link#visit"} do %>
10
10
  <span class="material-icons-outlined refine--icon-sm">clear</span>
11
11
  <% end %>
@@ -1,5 +1,5 @@
1
1
  module Refine
2
2
  module Rails
3
- VERSION = "2.13.0"
3
+ VERSION = "2.13.2"
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.13.0
4
+ version: 2.13.2
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: 2024-12-27 00:00:00.000000000 Z
12
+ date: 2025-01-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails