From: Anton Khorev Date: Thu, 5 Dec 2024 09:47:58 +0000 (+0300) Subject: Don't show types twice in issue type select X-Git-Tag: live~15^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/1c3e4746b0c901c19722ee6443266de325cca668 Don't show types twice in issue type select --- diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index fe900d627..516fb68ce 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -18,8 +18,8 @@ class IssuesController < ApplicationController @title = t ".title" @issue_types = [] - @issue_types.push("Note", "User") if current_user.moderator? - @issue_types.push("DiaryEntry", "DiaryComment", "User") if current_user.administrator? + @issue_types |= %w[Note User] if current_user.moderator? + @issue_types |= %w[DiaryEntry DiaryComment User] if current_user.administrator? @users = User.joins(:roles).where(:user_roles => { :role => current_user.roles.map(&:role) }).distinct @issues = Issue.visible_to(current_user)