refactor: adjust ordering of weather arts
Some checks failed
Docker / docker (push) Has been cancelled
CI / scan_ruby (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled

- Change ordering of previous weather art to use 'id' descending
- Change ordering of next weather art to use 'id' ascending
- Remove unnecessary blank line in seeds file

These changes enhance the consistency of the weather art
navigation by using 'id' for ordering, ensuring the
correct retrieval of records.
This commit is contained in:
songtianlun 2025-02-03 11:15:31 +08:00
parent 884e1dfc9f
commit 31c2913ea6
2 changed files with 2 additions and 3 deletions

View File

@ -5,12 +5,12 @@ class WeatherArtsController < ApplicationController
@previous_weather_art = @city.weather_arts
.where("id < ?", @weather_art.id)
.order(weather_date: :desc)
.order(id: :desc)
.first
@next_weather_art = @city.weather_arts
.where("id > ?", @weather_art.id)
.order(weather_date: :asc)
.order(id: :asc)
.first
ahoy.track "View Weather Art", {

View File

@ -204,4 +204,3 @@ guangzhou_weather_art3.image.attach(
filename: "sample-guangzhou-weather-art-2.png",
content_type: "image/png"
)