Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
smtlaissezfaire committed Dec 28, 2009
1 parent 6c653e2 commit 09d9248
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions lib/enhanced_query_analyzer/select_runner.rb
Expand Up @@ -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
Expand Down

0 comments on commit 09d9248

Please sign in to comment.