Commit ae134e67 authored by maeda's avatar maeda

Use pluck(:id) instead of collect(&:id) in app/models/issue.rb (#26711).


git-svn-id: https://svn.redmine.org/redmine/trunk@17455 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent d865565a
......@@ -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'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment