From 7d6c3ae6f5751dc009e919cfef99c9ff051147cb Mon Sep 17 00:00:00 2001 From: rvoss Date: Mon, 9 Oct 2023 13:43:24 +0200 Subject: [PATCH 1/2] =?UTF-8?q?Instanz-Gruppen=20bei=20m=C3=B6glichen=20Zu?= =?UTF-8?q?st=C3=A4ndigen=20Gruppen=20mit=20ber=C3=BCcksichtigen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/issues_helper.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 0ff59e39..f66c4b9e 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -123,8 +123,6 @@ def status_note_templates end def possible_group_ids(issue) - cond = '(ST_SetSRID(ST_MakePoint(:long, :lat), 4326) && "area")' - values = { long: issue.position.x, lat: issue.position.y } - AuthorityGroup.joins(:authority).where(cond, values).ids | CountyGroup.joins(:county).where(cond, values).ids + Group.regional(lat: issue.position.y, lon: issue.position.x).map(&:id) end end From f1dfde855f50266cc5e01e7c3f3f058208a4140e Mon Sep 17 00:00:00 2001 From: Niels Bennke Date: Thu, 12 Oct 2023 14:29:04 +0200 Subject: [PATCH 2/2] =?UTF-8?q?Rails=20helper=20f=C3=BCr=20den=20Zugriff?= =?UTF-8?q?=20auf=20die=20IDs=20einer=20Relation=20nutzen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/issues_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index f66c4b9e..46123ba1 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -123,6 +123,6 @@ def status_note_templates end def possible_group_ids(issue) - Group.regional(lat: issue.position.y, lon: issue.position.x).map(&:id) + Group.regional(lat: issue.position.y, lon: issue.position.x).ids end end