Patch by Felix Schäfer.
git-svn-id: http://svn.redmine.org/redmine/trunk@16381
e93f8b46-1217-0410-a6f0-
8f06a7374b81
project_ids = Array.wrap(attributes[:project_ids] || attributes[:project_id])
role_ids = attributes[:role_ids]
project_ids.each do |project_id|
- members << Member.new(:principal => principal, :role_ids => role_ids, :project_id => project_id)
+ member = Member.find_or_new(project_id, principal)
+ member.role_ids |= role_ids
+ member.save
+ members << member
end
- principal.members << members
end
members
end