Project

General

Profile

Defect #11662 ยป fix_empty_project.patch

exclude conditions for a role if the user has no projects with that role - Joe Rocklin, 2012-08-20 19:53

View differences:

app/models/project.rb
187 187
      if user.logged?
188 188
        user.projects_by_role.each do |role, projects|
189 189
          if role.allowed_to?(permission)
190
            statement_by_role[role] = "#{Project.table_name}.id IN (#{projects.collect(&:id).join(',')})"
190
            statement_by_role[role] = "#{Project.table_name}.id IN (#{projects.collect(&:id).join(',')})" unless projects.blank?
191 191
          end
192 192
        end
193 193
      end
    (1-1/1)