Permalink
Browse files

Code cleanup

  • Loading branch information...
1 parent 6c653e2 commit 09d9248c993962d60280af77440fba747375346d @smtlaissezfaire committed Dec 28, 2009
Showing with 4 additions and 10 deletions.
  1. +4 −10 lib/enhanced_query_analyzer/select_runner.rb
@@ -16,25 +16,19 @@ def explain_logging_on?
@explain_logging_on ? true : false
end
- def select(sql, name)
- if log_query?(sql)
- benchmark_and_run_query(sql, name)
- else
- run_query(sql, name)
- end
- end
-
def run_query(sql, name = nil)
@adapter.old_select_aliased_by_query_analyzer(sql, name)
end
- def benchmark_and_run_query(sql, name)
+ def select(sql, name)
result = nil
time = Benchmark.realtime do
result = run_query(sql, name)
end
- save_logged_query_time(sql, time)
+ if log_query?(sql)
+ save_logged_query_time(sql, time)
+ end
result
end

0 comments on commit 09d9248

Please sign in to comment.