]> source.dussan.org Git - redmine.git/commitdiff
Backported r9132 from trunk.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 7 Mar 2012 18:28:04 +0000 (18:28 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 7 Mar 2012 18:28:04 +0000 (18:28 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.3-stable@9149 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/members_controller.rb

index 6d5dd473377476ee9b63bf83ab61a04321b0bf5f..866ddca3a0723a4ddb81f4c2c64ec06a9df53dc2 100644 (file)
@@ -28,10 +28,10 @@ class MembersController < ApplicationController
       attrs = params[:member].dup
       if (user_ids = attrs.delete(:user_ids))
         user_ids.each do |user_id|
-          members << Member.new(attrs.merge(:user_id => user_id))
+          members << Member.new(:role_ids => params[:member][:role_ids], :user_id => user_id)
         end
       else
-        members << Member.new(attrs)
+        members << Member.new(:role_ids => params[:member][:role_ids], :user_id => params[:member][:user_id])
       end
       @project.members << members
     end
@@ -64,7 +64,10 @@ class MembersController < ApplicationController
   end
 
   def edit
-    if request.post? and @member.update_attributes(params[:member])
+    if params[:member]
+      @member.role_ids = params[:member][:role_ids]
+    end
+    if request.post? and @member.save
         respond_to do |format|
         format.html { redirect_to :controller => 'projects', :action => 'settings', :tab => 'members', :id => @project }
         format.js {