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 +4 -4
- data/app/models/refine/conditions/uses_attributes.rb +15 -2
- data/app/views/refine/advanced_inline/criteria/_condition_list_item_card.html.erb +1 -0
- data/app/views/refine/advanced_inline/filters/_criterion.html.erb +1 -1
- data/app/views/refine/inline/filters/_criterion.html.erb +1 -1
- data/lib/refine/rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67595ba20d0aeec9f9bae8d277b760b1928074c8a7946d92eda75a276855afd5
|
4
|
+
data.tar.gz: bb1917cfe855069d7e3c3df79c7ca8e12ba206b095a6e0db2263141ae405acb7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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)
|
@@ -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 %>
|
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.13.
|
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:
|
12
|
+
date: 2025-01-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|