Turn on event sorting

This commit is contained in:
Petko Bordjukov 2016-10-08 21:19:58 +03:00
parent 4954f5bbcd
commit 921bde2d4e
1 changed files with 3 additions and 1 deletions

View File

@ -1,9 +1,11 @@
class EventSearch class EventSearch
include SearchObject.module include SearchObject.module(:sorting)
option(:title) { |scope, value| scope.where title: value } option(:title) { |scope, value| scope.where title: value }
option(:language) { |scope, value| scope.where language: value } option(:language) { |scope, value| scope.where language: value }
option(:track_id) { |scope, value| scope.where track_id: value } option(:track_id) { |scope, value| scope.where track_id: value }
option(:event_type_id) { |scope, value| scope.where event_type_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}) } option(:status) { |scope, value| scope.joins(:proposition).where(propositions: {status: value}) }
sort_by :title
end end