mirror of
https://github.com/redmine/redmine.git
synced 2025-11-13 08:46:01 +01:00
Let admin users unarchive subprojects of archived projects (#29993).
git-svn-id: http://svn.redmine.org/redmine/trunk@17681 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -393,15 +393,11 @@ class Project < ActiveRecord::Base
|
||||
true
|
||||
end
|
||||
|
||||
# Unarchives the project
|
||||
# All its ancestors must be active
|
||||
# Unarchives the project and its archived ancestors
|
||||
def unarchive
|
||||
return false if ancestors.detect {|a| a.archived?}
|
||||
new_status = STATUS_ACTIVE
|
||||
if parent
|
||||
new_status = parent.status
|
||||
end
|
||||
update_attribute :status, new_status
|
||||
new_status = ancestors.any?(&:closed?) ? STATUS_CLOSED : STATUS_ACTIVE
|
||||
self_and_ancestors.status(STATUS_ARCHIVED).update_all :status => new_status
|
||||
reload
|
||||
end
|
||||
|
||||
def close
|
||||
|
||||
Reference in New Issue
Block a user