diff options
author | Go MAEDA <maeda@farend.jp> | 2018-07-29 05:45:40 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2018-07-29 05:45:40 +0000 |
commit | 7015e137fecaabac428c50738b7c315d1213c8b1 (patch) | |
tree | fb5aafb54d8a2eb4654b8859f5f14c33bc1fb941 | |
parent | 1c5600f8206a5f20e009ec79bce6c2b7b76ddecc (diff) | |
download | redmine-7015e137fecaabac428c50738b7c315d1213c8b1.tar.gz redmine-7015e137fecaabac428c50738b7c315d1213c8b1.zip |
Use pluck(:id) instead of collect(&:id) in app/models/issue.rb (#26711).
git-svn-id: http://svn.redmine.org/redmine/trunk@17455 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/models/issue.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index d04705d58..090677153 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -124,10 +124,10 @@ class Issue < ActiveRecord::Base when 'all' '1=1' when 'default' - user_ids = [user.id] + user.groups.map(&:id).compact + user_ids = [user.id] + user.groups.pluck(:id).compact "(#{table_name}.is_private = #{connection.quoted_false} OR #{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))" when 'own' - user_ids = [user.id] + user.groups.map(&:id).compact + user_ids = [user.id] + user.groups.pluck(:id).compact "(#{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))" else '1=0' |