2015-01-22 20:51:35 -05:00
|
|
|
module Projects
|
|
|
|
class AutocompleteService < BaseService
|
|
|
|
def issues
|
2016-03-17 16:39:56 -04:00
|
|
|
@project.issues.visible_to_user(current_user).opened.select([:iid, :title])
|
2015-01-22 20:51:35 -05:00
|
|
|
end
|
|
|
|
|
2016-04-04 22:37:50 -04:00
|
|
|
def milestones
|
2016-04-05 20:43:26 -04:00
|
|
|
@project.milestones.active.reorder(due_date: :asc, title: :asc).select([:iid, :title])
|
2016-04-04 22:37:50 -04:00
|
|
|
end
|
|
|
|
|
2015-01-22 20:51:35 -05:00
|
|
|
def merge_requests
|
2015-01-23 17:38:20 -05:00
|
|
|
@project.merge_requests.opened.select([:iid, :title])
|
2015-01-22 20:51:35 -05:00
|
|
|
end
|
2016-05-03 07:07:06 -04:00
|
|
|
|
|
|
|
def labels
|
|
|
|
@project.labels.select([:title, :color])
|
|
|
|
end
|
2015-01-22 20:51:35 -05:00
|
|
|
end
|
|
|
|
end
|