diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-11-02 20:55:02 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-11-02 20:55:02 +0000 |
commit | 4f4a019bebd03ffc0109a7004ae7c6bc0e562978 (patch) | |
tree | 34611e3afe82a111ad0b0141abc60c3f16a8c74f /app/controllers/projects_controller.rb | |
parent | f5e5822945901bef9302315927d1a31ef8dd0ef4 (diff) | |
download | redmine-4f4a019bebd03ffc0109a7004ae7c6bc0e562978.tar.gz redmine-4f4a019bebd03ffc0109a7004ae7c6bc0e562978.zip |
Moved controller code to new method Project#add_default_member.
git-svn-id: http://svn.redmine.org/redmine/trunk@13542 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/projects_controller.rb')
-rw-r--r-- | app/controllers/projects_controller.rb | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index beb279476..11cb91a46 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -76,11 +76,8 @@ class ProjectsController < ApplicationController if validate_parent_id && @project.save @project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id') - # Add current user as a project member if current user is not admin unless User.current.admin? - r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first - m = Member.new(:user => User.current, :roles => [r]) - @project.members << m + @project.add_default_member(User.current) end respond_to do |format| format.html { |