diff --git a/app/controllers/problems_controller.rb b/app/controllers/problems_controller.rb --- a/app/controllers/problems_controller.rb +++ b/app/controllers/problems_controller.rb @@ -75,7 +75,7 @@ end @problem.description = @description elsif @description - if !@description.update_attributes(description_params) + if !@description.update(description_params) flash[:notice] = 'Error saving description' render :action => 'edit' and return end @@ -84,7 +84,7 @@ flash[:notice] = 'Error: Uploaded file is not PDF' render :action => 'edit' and return end - if @problem.update_attributes(problem_params) + if @problem.update(problem_params) flash[:notice] = 'Problem was successfully updated.' unless params[:file] == nil or params[:file] == '' flash[:notice] = 'Problem was successfully updated and a new PDF file is uploaded.' @@ -117,7 +117,7 @@ def toggle @problem = Problem.find(params[:id]) - @problem.update_attributes(available: !(@problem.available) ) + @problem.update(available: !(@problem.available) ) respond_to do |format| format.js { } end @@ -125,7 +125,7 @@ def toggle_test @problem = Problem.find(params[:id]) - @problem.update_attributes(test_allowed: !(@problem.test_allowed?) ) + @problem.update(test_allowed: !(@problem.test_allowed?) ) respond_to do |format| format.js { } end @@ -133,7 +133,7 @@ def toggle_view_testcase @problem = Problem.find(params[:id]) - @problem.update_attributes(view_testcase: !(@problem.view_testcase?) ) + @problem.update(view_testcase: !(@problem.view_testcase?) ) respond_to do |format| format.js { } end