Error message when editing a child project without add project/subprojects permissions (#20282).

git-svn-id: http://svn.redmine.org/redmine/trunk@14619 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2015-09-21 20:32:11 +00:00
parent aa096cb0cc
commit 64a80066bd
3 changed files with 23 additions and 7 deletions

View File

@@ -39,7 +39,10 @@ module ObjectHelpers
project
end
def Project.generate_with_parent!(parent, attributes={})
def Project.generate_with_parent!(*args)
attributes = args.last.is_a?(Hash) ? args.pop : {}
parent = args.size > 0 ? args.first : Project.generate!
project = Project.generate!(attributes) do |p|
p.parent = parent
end