diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-03-16 12:24:44 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-03-17 09:39:16 +0300 |
commit | 5e3c9475a9332d7104a791f7bdfef30e069dd848 (patch) | |
tree | 780f1e5eb121d411ccfec0d9eaa66c7b41e97cb6 /app/helpers | |
parent | 1dd279d83335de71c69d0acfdcdd7eb0ebe7f3dd (diff) |
Add minor improvements in code related to issue move
Diffstat (limited to 'app/helpers')
-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) |