Feature #2705 » 2705-list-public-projects.diff
app/helpers/application_helper.rb (working copy) | ||
---|---|---|
347 | 347 | |
348 | 348 |
# Returns an array of projects that are displayed in the quick-jump box |
349 | 349 |
def projects_for_jump_box(user=User.current) |
350 |
if user.logged? |
|
351 |
user.projects.active.select(:id, :name, :identifier, :lft, :rgt).to_a |
|
352 |
else |
|
353 |
[] |
|
350 |
relations = [] |
|
351 |
relations << user.projects.active if user.logged? |
|
352 |
relations << Project.all_public |
|
353 |
relations.inject([]) do |projects, r| |
|
354 |
projects | r.select(:id, :name, :identifier, :lft, :rgt).to_a |
|
354 | 355 |
end |
355 | 356 |
end |
356 | 357 |
- « Previous
- 1
- 2
- Next »