Add Shift vote and recount date ranges, filter selected one on controller

This commit is contained in:
Bertocq
2017-09-27 18:08:03 +02:00
parent ce92dcd088
commit f40a0d09ed
3 changed files with 20 additions and 12 deletions

View File

@@ -54,7 +54,7 @@ class Admin::Poll::ShiftsController < Admin::Poll::BaseController
end
def shift_params
params.require(:shift).permit(:booth_id, :officer_id, :date, :task)
shift_params = params.require(:shift).permit(:booth_id, :officer_id, :task, date:[:vote_collection_date, :recount_scrutiny_date])
shift_params.merge(date: shift_params[:date]["#{shift_params[:task]}_date".to_sym])
end
end