]> source.dussan.org Git - redmine.git/commitdiff
Merged r12162 from trunk (#14902).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 13 Oct 2013 08:27:02 +0000 (08:27 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 13 Oct 2013 08:27:02 +0000 (08:27 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@12213 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue.rb

index c6b2ab7dafd49d997f512c37add71ab0088fe62f..86e456120b3bd781c5fc5f2fe72e287896332f07 100644 (file)
@@ -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'