extracts officer_assignments from admin's poll/show

This commit is contained in:
Juanjo Bazán
2017-02-14 13:47:33 +01:00
parent 20e31133a8
commit 19ec7f93b3
13 changed files with 225 additions and 204 deletions

View File

@@ -9,11 +9,9 @@ class Admin::Poll::PollsController < Admin::BaseController
def show
@poll = Poll.includes(:questions,
booth_assignments: [:booth,
:final_recounts,
:recounts],
officers: [:user]).
order('poll_questions.title', 'poll_booths.name', 'users.username').
booth_assignments: [:final_recounts,
:recounts]).
order('poll_questions.title').
find(params[:id])
end
@@ -70,14 +68,6 @@ class Admin::Poll::PollsController < Admin::BaseController
end
end
def search_officers
@officers = User.joins(:poll_officer).search(@search).order(username: :asc)
respond_to do |format|
format.js
end
end
private
def load_geozones
@geozones = Geozone.all.order(:name)