Commit 61815b77 by jimabramson

add new relic trace to code block

parent a4ef0d4f
require 'new_relic/agent/method_tracer'
helpers do helpers do
def commentable def commentable
...@@ -118,20 +120,21 @@ helpers do ...@@ -118,20 +120,21 @@ helpers do
if params[:course_id] if params[:course_id]
comment_threads = comment_threads.where(:course_id=>params[:course_id]) comment_threads = comment_threads.where(:course_id=>params[:course_id])
if params[:flagged] if params[:flagged]
#get flagged threads and threads containing flagged responses self.class.trace_execution_scoped(['Custom/handle_threads_query/find_flagged']) do
comment_ids = Comment.where(:course_id=>params[:course_id]). #get flagged threads and threads containing flagged responses
where(:abuse_flaggers.ne => [],:abuse_flaggers.exists => true). comment_ids = Comment.where(:course_id=>params[:course_id]).
collect{|c| c.comment_thread_id}.uniq 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). comment_threads = comment_threads.where(:id.in => comment_ids)
collect{|c| c.id} end
comment_ids += thread_ids
comment_threads = comment_threads.where(:id.in => comment_ids)
end 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