Project

General

Profile

Feature #2705 » 2705-list-public-projects.diff

patch for 3.3.2.devel.16430 - Go MAEDA, 2017-03-28 13:26

View differences:

app/helpers/application_helper.rb (working copy)
# Returns an array of projects that are displayed in the quick-jump box
def projects_for_jump_box(user=User.current)
if user.logged?
user.projects.active.select(:id, :name, :identifier, :lft, :rgt).to_a
else
[]
relations = []
relations << user.projects.active if user.logged?
relations << Project.all_public
relations.inject([]) do |projects, r|
projects | r.select(:id, :name, :identifier, :lft, :rgt).to_a
end
end
(2-2/2)