Remove attr_accessible from Program and Cfp, final fixes after introducing strong params

This commit is contained in:
Stella Rouzi 2016-01-13 14:15:12 +02:00 committed by Henne Vogelsang
parent 62a7e724a2
commit a0d045e156
8 changed files with 95 additions and 105 deletions

View file

@ -10,10 +10,10 @@ module Admin
def update
authorize! :update, @conference.program
@program = @conference.program
@program.assign_attributes(params[:program])
@program.assign_attributes(program_params)
# send_mail_on_schedule_public = @program.notify_on_schedule_public?
if @program.update_attributes(params[:program])
if @program.update_attributes(program_params)
# Mailbot.delay.send_on_schedule_public(@conference) if send_mail_on_schedule_public
redirect_to(admin_conference_program_path(@conference.short_title),
notice: 'The program was successfully updated.')
@ -26,7 +26,7 @@ module Admin
private
def program_params
params[:program]
params.require(:program).permit(:rating, :schedule_public, :schedule_fluid)
end
end
end