Commit 61815b77 by jimabramson

add new relic trace to code block

parent a4ef0d4f
require 'new_relic/agent/method_tracer'
helpers do
def commentable
......@@ -118,20 +120,21 @@ helpers do
if params[:course_id]
comment_threads = comment_threads.where(:course_id=>params[:course_id])
if params[:flagged]
#get flagged threads and threads containing flagged responses
comment_ids = Comment.where(:course_id=>params[:course_id]).
where(:abuse_flaggers.ne => [],:abuse_flaggers.exists => true).
collect{|c| c.comment_thread_id}.uniq
self.class.trace_execution_scoped(['Custom/handle_threads_query/find_flagged']) do
#get flagged threads and threads containing flagged responses
comment_ids = Comment.where(:course_id=>params[:course_id]).
where(:abuse_flaggers.ne => [],:abuse_flaggers.exists => true).
collect{|c| c.comment_thread_id}.uniq
thread_ids = comment_threads.where(:abuse_flaggers.ne => [],:abuse_flaggers.exists => true).
collect{|c| c.id}
comment_ids += thread_ids
thread_ids = comment_threads.where(:abuse_flaggers.ne => [],:abuse_flaggers.exists => true).
collect{|c| c.id}
comment_ids += thread_ids
comment_threads = comment_threads.where(:id.in => comment_ids)
comment_threads = comment_threads.where(:id.in => comment_ids)
end
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment