gitlab-org--gitlab-foss/app/services/projects/autocomplete_service.rb

20 lines
457 B
Ruby
Raw Normal View History

module Projects
class AutocompleteService < BaseService
def issues
@project.issues.visible_to_user(current_user).opened.select([:iid, :title])
end
def milestones
@project.milestones.active.reorder(due_date: :asc, title: :asc).select([:iid, :title])
end
def merge_requests
@project.merge_requests.opened.select([:iid, :title])
end
2016-05-03 07:07:06 -04:00
def labels
@project.labels.select([:title, :color])
end
end
end