From: Jean-Philippe Lang Date: Sun, 13 Oct 2013 08:27:02 +0000 (+0000) Subject: Merged r12162 from trunk (#14902). X-Git-Tag: 2.3.4~10 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=daf2d54f27bea153c35fe822a327f797cc43782d;p=redmine.git Merged r12162 from trunk (#14902). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@12213 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/issue.rb b/app/models/issue.rb index c6b2ab7da..86e456120 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -106,10 +106,10 @@ class Issue < ActiveRecord::Base when 'all' nil when 'default' - user_ids = [user.id] + user.groups.map(&:id) + user_ids = [user.id] + user.groups.map(&: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) + user_ids = [user.id] + user.groups.map(&:id).compact "(#{table_name}.author_id = #{user.id} OR #{table_name}.assigned_to_id IN (#{user_ids.join(',')}))" else '1=0'