From e78b054ad2b54b253b9b4ac20034177f9c47d21c Mon Sep 17 00:00:00 2001 From: Ben Rexin Date: Mon, 13 Jan 2025 21:52:54 +0100 Subject: [PATCH] feat: limit locations to since beginning of two years ago --- app/controllers/home_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index deaebf361..8fb94a6f5 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -8,7 +8,7 @@ class HomeController < ApplicationController expose(:upcoming_topics) { Topic.ordered.upcoming } expose(:done_topics) { Topic.ordered.done.limit(10) } expose(:organizers) { User.organizers } - expose(:locations) { Location.all } + expose(:locations) { Location.joins(:events).merge(Event.where(date: (2.years.ago.beginning_of_year)..)).distinct } expose(:zoom) { Whitelabel[:location][:zoom] } def index; end