Project

General

Profile

Patch #26122 » revert_exists.patch

Pavel Rosický, 2017-06-07 22:51

View differences:

project.rb (working copy)
181 181
    base_statement = (perm && perm.read? ? "#{Project.table_name}.status <> #{Project::STATUS_ARCHIVED}" : "#{Project.table_name}.status = #{Project::STATUS_ACTIVE}")
182 182
    if !options[:skip_pre_condition] && perm && perm.project_module
183 183
      # If the permission belongs to a project module, make sure the module is enabled
184
      base_statement << " AND EXISTS (SELECT 1 AS one FROM #{EnabledModule.table_name} em WHERE em.project_id = #{Project.table_name}.id AND em.name='#{perm.project_module}')"
184
      base_statement << " AND #{Project.table_name}.id IN (SELECT em.project_id FROM #{EnabledModule.table_name} em WHERE em.name='#{perm.project_module}')"
185 185
    end
186 186
    if project = options[:project]
187 187
      project_statement = project.project_condition(options[:with_subprojects])
(2-2/3)