Updated Ruby

This commit is contained in:
Phil Hughes 2016-05-25 15:26:02 +01:00
parent 672bd4e6ff
commit 50a16c4bd7
1 changed files with 5 additions and 2 deletions

View File

@ -39,8 +39,11 @@ class AutocompleteController < ApplicationController
current_user.can?(:admin_issue, project)
end
no_project = OpenStruct.new(id: 0, name_with_namespace: 'No project')
projects.unshift(no_project.to_h)
no_project = {
id: 0,
name_with_namespace: 'No project',
}
projects.unshift(no_project)
projects.delete(project)
render json: projects.to_json(only: [:id, :name_with_namespace], methods: :name_with_namespace)