summaryrefslogtreecommitdiffstats
path: root/app/controllers/queries_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-09 14:10:49 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-09 14:10:49 +0000
commitab066317e62b3a6082fc82ba57915ed02f0f6699 (patch)
tree7889bbe8150f7aa9ed03a8970e9c999e33e378f1 /app/controllers/queries_controller.rb
parentfb9a87f53ecd1bce3afef08cea0237e227cd400d (diff)
downloadredmine-ab066317e62b3a6082fc82ba57915ed02f0f6699.tar.gz
redmine-ab066317e62b3a6082fc82ba57915ed02f0f6699.zip
Adds STI to Query model. Issue queries are now IssueQuery instances.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10964 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/queries_controller.rb')
-rw-r--r--app/controllers/queries_controller.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/controllers/queries_controller.rb b/app/controllers/queries_controller.rb
index 546905ec9..1ecb62b68 100644
--- a/app/controllers/queries_controller.rb
+++ b/app/controllers/queries_controller.rb
@@ -32,9 +32,9 @@ class QueriesController < ApplicationController
@limit = per_page_option
end
- @query_count = Query.visible.count
+ @query_count = IssueQuery.visible.count
@query_pages = Paginator.new self, @query_count, @limit, params['page']
- @queries = Query.visible.all(:limit => @limit, :offset => @offset, :order => "#{Query.table_name}.name")
+ @queries = IssueQuery.visible.all(:limit => @limit, :offset => @offset, :order => "#{Query.table_name}.name")
respond_to do |format|
format.html { render :nothing => true }
@@ -43,7 +43,7 @@ class QueriesController < ApplicationController
end
def new
- @query = Query.new
+ @query = IssueQuery.new
@query.user = User.current
@query.project = @project
@query.is_public = false unless User.current.allowed_to?(:manage_public_queries, @project) || User.current.admin?
@@ -51,7 +51,7 @@ class QueriesController < ApplicationController
end
def create
- @query = Query.new(params[:query])
+ @query = IssueQuery.new(params[:query])
@query.user = User.current
@query.project = params[:query_is_for_all] ? nil : @project
@query.is_public = false unless User.current.allowed_to?(:manage_public_queries, @project) || User.current.admin?
@@ -91,7 +91,7 @@ class QueriesController < ApplicationController
private
def find_query
- @query = Query.find(params[:id])
+ @query = IssueQuery.find(params[:id])
@project = @query.project
render_403 unless @query.editable_by?(User.current)
rescue ActiveRecord::RecordNotFound