Make sure we don't build an empty IN () statement (#11662).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10241 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
c68ee7f545
commit
50506ef621
|
@ -187,7 +187,7 @@ class Project < ActiveRecord::Base
|
|||
end
|
||||
if user.logged?
|
||||
user.projects_by_role.each do |role, projects|
|
||||
if role.allowed_to?(permission)
|
||||
if role.allowed_to?(permission) && projects.any?
|
||||
statement_by_role[role] = "#{Project.table_name}.id IN (#{projects.collect(&:id).join(',')})"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue