Skip to content

Instantly share code, notes, and snippets.

@jugyo
Created June 4, 2009 09:23
Show Gist options
  • Save jugyo/123535 to your computer and use it in GitHub Desktop.
Save jugyo/123535 to your computer and use it in GitHub Desktop.
# Output SQL to growl
# The library 'g' is required. Install as follows:
# sudo gem install g
require 'g'
module ActiveRecord::ConnectionAdapters # :nodoc:
class AbstractAdapter
protected
def log_info_with_feature(sql, name, runtime)
if /insert|update/i =~ sql
g sql
end
log_info_without_feature(sql, name, runtime)
end
alias_method_chain :log_info, :feature
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment