Moves project attributes default assignments from ProjectsController#new to the model (#6064).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4460 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2010-12-03 16:15:16 +00:00
parent f6c633212a
commit 9284a32c9a
5 changed files with 58 additions and 7 deletions
+1 -6
View File
@@ -68,11 +68,6 @@ class ProjectsController < ApplicationController
@issue_custom_fields = IssueCustomField.find(:all, :order => "#{CustomField.table_name}.position")
@trackers = Tracker.all
@project = Project.new(params[:project])
@project.identifier = Project.next_identifier if Setting.sequential_project_identifiers?
@project.trackers = Tracker.all
@project.is_public = Setting.default_projects_public?
@project.enabled_module_names = Setting.default_projects_modules
end
def create
@@ -80,7 +75,7 @@ class ProjectsController < ApplicationController
@trackers = Tracker.all
@project = Project.new(params[:project])
@project.enabled_module_names = params[:enabled_modules]
@project.enabled_module_names = params[:enabled_modules] if params[:enabled_modules]
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 he is not admin