mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-20 07:21:12 +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:
parent
05e24edda9
commit
97efebf08e
@ -22,6 +22,11 @@ class ProjectQuery < Query
|
|||||||
self.queried_class = Project
|
self.queried_class = Project
|
||||||
self.view_permission = :search_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 = [
|
self.available_columns = [
|
||||||
QueryColumn.new(:name, :sortable => "#{Project.table_name}.name"),
|
QueryColumn.new(:name, :sortable => "#{Project.table_name}.name"),
|
||||||
QueryColumn.new(:status, :sortable => "#{Project.table_name}.status"),
|
QueryColumn.new(:status, :sortable => "#{Project.table_name}.status"),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user