1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-10-17 17:01:01 +00:00

Make sure we cannot create a ProjectQuery on a given project (#29482).

git-svn-id: http://svn.redmine.org/redmine/trunk@19093 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2019-11-20 15:53:04 +00:00
parent 05e24edda9
commit 97efebf08e

View 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"),