]> source.dussan.org Git - redmine.git/commitdiff
Merged r19093 to 4.1-stable (#29482).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 20 Nov 2019 16:03:33 +0000 (16:03 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 20 Nov 2019 16:03:33 +0000 (16:03 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/4.1-stable@19101 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/project_query.rb

index 49c8f5e99040a075839219c938e00ea2fc017163..5957ecb418e69c1a745d807789d16212ebc4e898 100644 (file)
@@ -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"),