Skip to content

Instantly share code, notes, and snippets.

Avatar

Milovan Zogovic assembler

View GitHub Profile
View README.md

Rails 4 fork

Benchmark Bundler

Because loading gems can take longer than you think

$ curl -fsSL https://gist.github.com/raw/6121664/benchmark.rb | ruby
............................................................[DONE]
@assembler
assembler / descriptive_sql_load_log.rb
Created Dec 7, 2011 — forked from jlindley/descriptive_sql_load_log.rb
Let Rails display file names and line numbers for log activity.
View descriptive_sql_load_log.rb
module ActiveRecord
module ConnectionAdapters
class AbstractAdapter
protected
# Rails 3.1
def log_with_trace(sql, name = "SQL", binds = [], &block)
if @logger && @logger.debug?
c = caller.detect{|line| line !~ /(activerecord|active_support|__DELEGATION__|\/lib\/|\/vendor\/plugins|\/vendor\/gems)/i}
c ||= caller.first
You can’t perform that action at this time.