From 4f8150090bed40e5f02dc4541627fc8104e1ec49 Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Sat, 8 Oct 2016 21:40:55 +0300 Subject: [PATCH] Reverse sort direction for Events --- app/models/event_search.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/event_search.rb b/app/models/event_search.rb index 1343d31..decb861 100644 --- a/app/models/event_search.rb +++ b/app/models/event_search.rb @@ -7,5 +7,6 @@ class EventSearch option(:event_type_id) { |scope, value| scope.where event_type_id: value } option(:status) { |scope, value| scope.joins(:proposition).where(propositions: {status: value}) } - sort_by :title + sort_by 'title' + config[:defaults]['sort'] = "#{config[:sort_attributes].first} asc" end