From 921bde2d4e7fbf335dec5f1c54bee80c1bea7143 Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Sat, 8 Oct 2016 21:19:58 +0300 Subject: [PATCH] Turn on event sorting --- app/models/event_search.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/event_search.rb b/app/models/event_search.rb index 5c068ac..1343d31 100644 --- a/app/models/event_search.rb +++ b/app/models/event_search.rb @@ -1,9 +1,11 @@ class EventSearch - include SearchObject.module + include SearchObject.module(:sorting) option(:title) { |scope, value| scope.where title: value } option(:language) { |scope, value| scope.where language: value } option(:track_id) { |scope, value| scope.where track_id: value } 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 end