From 5f30e08a6eebe4979736d817faf3ba2f3e2ff3d6 Mon Sep 17 00:00:00 2001 From: songtianlun Date: Sun, 26 Jan 2025 23:49:35 +0800 Subject: [PATCH] refactor: update city ordering Order cities by name instead of filtering active cities. This change simplifies the CitiesController and improves code readability. - Update City.includes method in CitiesController - Remove active filter in City.includes method --- app/controllers/cities_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/cities_controller.rb b/app/controllers/cities_controller.rb index a310b9d..12acd0f 100644 --- a/app/controllers/cities_controller.rb +++ b/app/controllers/cities_controller.rb @@ -1,7 +1,7 @@ class CitiesController < ApplicationController def index @regions = Region.includes(:countries).order(:name) - @cities = City.includes(:country, country: :region).active.order(:name) + @cities = City.includes(:country, country: :region).order(:name) if params[:region] @current_region = Region.friendly.find(params[:region])