summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/feeds_controller.rb2
-rw-r--r--app/controllers/projects_controller.rb3
-rw-r--r--app/controllers/queries_controller.rb1
3 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/feeds_controller.rb b/app/controllers/feeds_controller.rb
index 9314db5e3..214f80c95 100644
--- a/app/controllers/feeds_controller.rb
+++ b/app/controllers/feeds_controller.rb
@@ -37,6 +37,7 @@ class FeedsController < ApplicationController
def issues
if @project && params[:query_id]
query = Query.find(params[:query_id])
+ query.executed_by = @user
# ignore query if it's not valid
query = nil unless query.valid?
# override with query conditions
@@ -56,6 +57,7 @@ class FeedsController < ApplicationController
def history
if @project && params[:query_id]
query = Query.find(params[:query_id])
+ query.executed_by = @user
# ignore query if it's not valid
query = nil unless query.valid?
# override with query conditions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 82468c21a..e90196495 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -647,11 +647,12 @@ private
def retrieve_query
if params[:query_id]
@query = @project.queries.find(params[:query_id])
+ @query.executed_by = logged_in_user
session[:query] = @query
else
if params[:set_filter] or !session[:query] or session[:query].project_id != @project.id
# Give it a name, required to be valid
- @query = Query.new(:name => "_")
+ @query = Query.new(:name => "_", :executed_by => logged_in_user)
@query.project = @project
if params[:fields] and params[:fields].is_a? Array
params[:fields].each do |field|
diff --git a/app/controllers/queries_controller.rb b/app/controllers/queries_controller.rb
index 7f7f01fd3..abafd19d4 100644
--- a/app/controllers/queries_controller.rb
+++ b/app/controllers/queries_controller.rb
@@ -42,6 +42,7 @@ class QueriesController < ApplicationController
private
def find_query
@query = Query.find(params[:id])
+ @query.executed_by = logged_in_user
@project = @query.project
# check if user is allowed to manage queries (same permission as add_query)
authorize('projects', 'add_query')