From: Jean-Philippe Lang Date: Wed, 20 Nov 2019 16:03:33 +0000 (+0000) Subject: Merged r19093 to 4.1-stable (#29482). X-Git-Tag: 4.1.0~32 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e5d82b1fab61669d0f727cde11bd42c21ab8640b;p=redmine.git Merged r19093 to 4.1-stable (#29482). git-svn-id: http://svn.redmine.org/redmine/branches/4.1-stable@19101 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/project_query.rb b/app/models/project_query.rb index 49c8f5e99..5957ecb41 100644 --- a/app/models/project_query.rb +++ b/app/models/project_query.rb @@ -22,6 +22,11 @@ class ProjectQuery < Query self.queried_class = Project self.view_permission = :search_project + validate do |query| + # project must be blank for ProjectQuery + errors.add(:project_id, :exclusion) if query.project_id.present? + end + self.available_columns = [ QueryColumn.new(:name, :sortable => "#{Project.table_name}.name"), QueryColumn.new(:status, :sortable => "#{Project.table_name}.status"),