diff --git a/app/controllers/arts_controller.rb b/app/controllers/arts_controller.rb index 5fb842c..6fa9182 100644 --- a/app/controllers/arts_controller.rb +++ b/app/controllers/arts_controller.rb @@ -3,7 +3,7 @@ class ArtsController < ApplicationController @regions = Region.all @current_region = Region.find(params[:region]) if params[:region].present? - @weather_arts = WeatherArt.includes(city: [ :country, { country: :region } ]) + @weather_arts = WeatherArt.includes(city: [ :country ]).includes(:image_attachment) if @current_region @weather_arts = @weather_arts.joins(city: :country) diff --git a/app/controllers/cities_controller.rb b/app/controllers/cities_controller.rb index 217a57d..05a6c71 100644 --- a/app/controllers/cities_controller.rb +++ b/app/controllers/cities_controller.rb @@ -3,7 +3,7 @@ class CitiesController < ApplicationController before_action :require_admin, only: [ :generate_weather_art ] def index - @regions = Region.includes(:countries).order(:name) + @regions = Region.order(:name) @cities = City.includes(:country, country: :region).order(:name) if params[:query].present?