Order translations using ruby
Joining the translations table caused duplicate records to appear. Ordering with SQL is simply too hard because we need to consider fallback locales. Thanks Senén for providing most of the tests in the poll spec.
This commit is contained in:
@@ -12,8 +12,9 @@ class PollsController < ApplicationController
|
||||
::Poll::Answer # trigger autoload
|
||||
|
||||
def index
|
||||
@polls = @polls.not_budget.public_polls.send(@current_filter).includes(:geozones)
|
||||
.sort_for_list.page(params[:page])
|
||||
@polls = Kaminari.paginate_array(
|
||||
@polls.public_polls.not_budget.send(@current_filter).includes(:geozones).sort_for_list
|
||||
).page(params[:page])
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
Reference in New Issue
Block a user