Fix exception when trying to filter by volunteer team

This commit is contained in:
Petko Bordjukov 2019-06-16 10:30:08 +03:00
parent 8daac96d55
commit f724e58800
1 changed files with 5 additions and 1 deletions

View File

@ -3,7 +3,7 @@ module Management
include CurrentConferenceAssigning include CurrentConferenceAssigning
def index def index
@filters = params[:filters] || {} @filters = filter_params || {}
@volunteers = VolunteerSearch.new(scope: Volunteer.where(conference: current_conference).eager_load(:volunteer_teams), filters: params[:filters]).results @volunteers = VolunteerSearch.new(scope: Volunteer.where(conference: current_conference).eager_load(:volunteer_teams), filters: params[:filters]).results
end end
@ -27,6 +27,10 @@ module Management
private private
def filter_params
params.fetch(:filters, {}).permit(:volunteer_team_id)
end
def volunteer_params def volunteer_params
params.require(:volunteer).permit(:name, :picture, :email, :phone, params.require(:volunteer).permit(:name, :picture, :email, :phone,
:tshirt_size, :tshirt_cut, :tshirt_size, :tshirt_cut,