Feature #2705 » 2705-list-public-projects.diff
| 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
|
||
- « Previous
- 1
- 2
- Next »