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)
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

  
(2-2/2)