gitlab-org--gitlab-foss/app/services/projects/autocomplete_service.rb
Fatih Acet 046b5735bc Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into add_autocomplete_for_labels
# Conflicts:
#	app/assets/javascripts/gfm_auto_complete.js.coffee
2016-06-14 00:56:59 +03:00

19 lines
457 B
Ruby

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
def labels
@project.labels.select([:title, :color])
end
end
end