From 24de9ba4e61f42be60c64daf76727998b7e720cd Mon Sep 17 00:00:00 2001 From: "Justin Craig-Kuhn (JCK)" Date: Wed, 18 Oct 2023 18:42:13 -0700 Subject: [PATCH] Fix sorting on Tour page --- app/controllers/concerns/ambiguity/tour_name.rb | 12 ++++++------ app/helpers/sort_helper.rb | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/controllers/concerns/ambiguity/tour_name.rb b/app/controllers/concerns/ambiguity/tour_name.rb index ba522b22..f1bbcc98 100644 --- a/app/controllers/concerns/ambiguity/tour_name.rb +++ b/app/controllers/concerns/ambiguity/tour_name.rb @@ -17,17 +17,17 @@ def tour end def hydrate_tour_page - @ogp_title = "Listen to shows from #{@tour.name}" - @shows = @tour.shows.sort_by(&:date).reverse + @ogp_title = "Listen to shows from #{tour.name}" + @shows = tour.shows.order(@order_by) @shows_likes = user_likes_for_shows(@shows) - @sections = sections - @title = @tour.name + @sections = tour_sections + @title = tour.name @view = 'shows/index' end - def sections + def tour_sections { - @tour.name => { + tour.name => { shows: @shows, likes: @shows_likes } diff --git a/app/helpers/sort_helper.rb b/app/helpers/sort_helper.rb index b5084ee7..82e82f18 100644 --- a/app/helpers/sort_helper.rb +++ b/app/helpers/sort_helper.rb @@ -53,7 +53,7 @@ def sort_songs_title(items) def show_sort_items { ' Reverse Date' => 'date desc', - ' Date' => 'date', + ' Date' => 'date asc', ' Likes' => 'likes', ' Duration' => 'duration' }