From c8412bc9edbbed7a38cc4880f0d8cbb9091eb1d9 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 3 Oct 2012 15:02:02 +0300 Subject: [PATCH] Dont change params hash. Use dup instead --- app/controllers/admin/groups_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/groups_controller.rb b/app/controllers/admin/groups_controller.rb index 49082e1..bfde654 100644 --- a/app/controllers/admin/groups_controller.rb +++ b/app/controllers/admin/groups_controller.rb @@ -32,13 +32,14 @@ class Admin::GroupsController < AdminController end def update - owner_id = params[:group].delete(:owner_id) + group_params = params[:group].dup + owner_id =group_params.delete(:owner_id) if owner_id @group.owner = User.find(owner_id) end - if @group.update_attributes(params[:group]) + if @group.update_attributes(group_params) redirect_to [:admin, @group], notice: 'Group was successfully updated.' else render action: "edit" -- libgit2 0.21.2