##// END OF EJS Templates
Use scope....
Jean-Philippe Lang -
r13310:49bd22255fbe
parent child
Show More
@@ -368,7 +368,7 class Project < ActiveRecord::Base
368 368 # by the current user
369 369 def allowed_parents
370 370 return @allowed_parents if @allowed_parents
371 @allowed_parents = Project.where(Project.allowed_to_condition(User.current, :add_subprojects)).to_a
371 @allowed_parents = Project.allowed_to(User.current, :add_subprojects).to_a
372 372 @allowed_parents = @allowed_parents - self_and_descendants
373 373 if User.current.allowed_to?(:add_project, nil, :global => true) || (!new_record? && parent.nil?)
374 374 @allowed_parents << nil
General Comments 0
You need to be logged in to leave comments. Login now