clarion/app/models/volunteer_search.rb
2016-10-09 07:17:34 +03:00

9 lines
268 B
Ruby

class VolunteerSearch
include SearchObject.module(:sorting)
option(:volunteer_team_id) { |scope, value| scope.joins(:volunteer_teams).where volunteer_teams: {id: value} }
sort_by 'name'
config[:defaults]['sort'] = "#{config[:sort_attributes].first} asc"
end