diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-03-16 10:24:44 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-03-17 07:39:16 +0100 |
commit | 5e3c9475a9332d7104a791f7bdfef30e069dd848 (patch) | |
tree | 780f1e5eb121d411ccfec0d9eaa66c7b41e97cb6 /app/helpers/issues_helper.rb | |
parent | 1dd279d83335de71c69d0acfdcdd7eb0ebe7f3dd (diff) | |
download | gitlab-ce-5e3c9475a9332d7104a791f7bdfef30e069dd848.tar.gz |
Add minor improvements in code related to issue move
Diffstat (limited to 'app/helpers/issues_helper.rb')
-rw-r--r-- | app/helpers/issues_helper.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 62479b8d1ce..b67057ebc7c 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -60,12 +60,14 @@ module IssuesHelper def project_options(issuable, current_user, ability: :read_project) projects = current_user.authorized_projects projects = projects.select do |project| - current_user.can?(ability, project) && project != issuable.project + current_user.can?(ability, project) end - projects.unshift(OpenStruct.new(id: 0, name_with_namespace: 'No project')) + no_project = OpenStruct.new(id: 0, name_with_namespace: 'No project') + projects.unshift(no_project) + projects.delete(issuable.project) - options_from_collection_for_select(projects, :id, :name_with_namespace, 0) + options_from_collection_for_select(projects, :id, :name_with_namespace) end def status_box_class(item) |