mirror of
https://github.com/meineerde/redmine.git
synced 2026-01-17 04:42:56 +00:00
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
This commit is contained in:
parent
1c5600f820
commit
7015e137fe
@ -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'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user