From c4368b077a2f55b2a02d3d8885124c7e98914d1c Mon Sep 17 00:00:00 2001 From: taitus Date: Fri, 24 Oct 2025 10:38:50 +0200 Subject: [PATCH] Remove unused by_geozone_id scope from Poll The "by_geozone_id" scope in Poll is no longer used anywhere in the code. It was first introduced in commit 20cb0440150e ("adds search and filter for poll questions") and later moved to the Poll model in commit d02450596048 ("moves geozones from poll question to poll in models"), but has never been referenced since. --- app/models/poll.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/models/poll.rb b/app/models/poll.rb index 8012f2fcd..71f031a56 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -71,7 +71,6 @@ class Poll < ApplicationRecord scope :expired, -> { where(ends_at: ...Time.current) } scope :recounting, -> { where(ends_at: (RECOUNT_DURATION.ago)...Time.current) } scope :published, -> { where(published: true) } - scope :by_geozone_id, ->(geozone_id) { where(geozones: { id: geozone_id }.joins(:geozones)) } scope :public_for_api, -> { all } scope :not_budget, -> { where(budget_id: nil) } scope :created_by_admin, -> { where(related_type: nil) }