Remove duplicate scope
The scopes `created_by_admin` and `public_polls` were very similar. I'm using `created_by_admin` because `Poll.public_polls` feels redundant, and the reason for that name is we should not name the scope `public` because `public` is a ruby access modifier.
This commit is contained in:
@@ -13,7 +13,7 @@ class PollsController < ApplicationController
|
||||
|
||||
def index
|
||||
@polls = Kaminari.paginate_array(
|
||||
@polls.public_polls.not_budget.send(@current_filter).includes(:geozones).sort_for_list
|
||||
@polls.created_by_admin.not_budget.send(@current_filter).includes(:geozones).sort_for_list
|
||||
).page(params[:page])
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user