Moves enabled_module_names param to project attribute so that it can be set through the Project API.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4645 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2011-01-06 20:36:31 +00:00
parent 7620142b70
commit 9fb770ba50
6 changed files with 61 additions and 7 deletions
+4 -1
View File
@@ -66,7 +66,7 @@ class Project < ActiveRecord::Base
:url => Proc.new {|o| {:controller => 'projects', :action => 'show', :id => o}},
:author => nil
attr_protected :status, :enabled_module_names
attr_protected :status
validates_presence_of :name, :identifier
validates_uniqueness_of :identifier
@@ -533,6 +533,9 @@ class Project < ActiveRecord::Base
'tracker_ids',
'issue_custom_field_ids'
safe_attributes 'enabled_module_names',
:if => lambda {|project, user| project.new_record? || user.allowed_to?(:select_project_modules, project) }
# Returns an array of projects that are in this project's hierarchy
#
# Example: parents, children, siblings