decidim-plans 0.16.7 → 0.16.8
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: 170eb87417645430c9d009737c52ae84141168dd7f493bd1e39edb9255b7bab9
|
|
4
|
+
data.tar.gz: 143a0c3f27aaf4ab7519acdaa21276c256fb77e9226ad46619161f4ae0824a3c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d9fa85970c423d8d6452073255d26c33e100ace96feed0e9d22f924b93f6927ba415ee94effaf6e0319a6fd95c58c3cc45adc4757582f96f562a66d2eb4553cf
|
|
7
|
+
data.tar.gz: 60ff131f7331cab36ee5574bc64e7b15e120710945c535e30d6280f2b7af015e0bc57fa3da3e994e1eb5a6df1f53cf393de95fb8d690cc1768fe4edc9b2e424f
|
|
@@ -51,7 +51,7 @@ module Decidim
|
|
|
51
51
|
on(:ok) do
|
|
52
52
|
flash[:notice] = I18n.t("create.success", scope: i18n_flashes_scope)
|
|
53
53
|
|
|
54
|
-
return redirect_to taggings_plan_path(plan) if @form.back_to_plan
|
|
54
|
+
return redirect_to taggings_plan_path(plan) if @form.back_to_plan == true
|
|
55
55
|
|
|
56
56
|
redirect_to plan_tags_path(plan)
|
|
57
57
|
end
|
|
@@ -79,7 +79,16 @@ module Decidim
|
|
|
79
79
|
def search_tag_id
|
|
80
80
|
return query unless tag_id.is_a? Array
|
|
81
81
|
|
|
82
|
-
query
|
|
82
|
+
# Fetch the plan IDs as a separate query in order to avoid duplicate
|
|
83
|
+
# entries in the final result. We could also use `.distinct` on the
|
|
84
|
+
# main query but that would limit what the user could further on do with
|
|
85
|
+
# that query. Therefore, in this context it is safer to just fetch these
|
|
86
|
+
# in a completely separate query.
|
|
87
|
+
plan_ids = Plan.joins(:tags).where(
|
|
88
|
+
decidim_plans_tags: { id: tag_id }
|
|
89
|
+
).distinct.pluck(:id)
|
|
90
|
+
|
|
91
|
+
query.where(id: plan_ids)
|
|
83
92
|
end
|
|
84
93
|
|
|
85
94
|
private
|