Created
June 4, 2009 09:23
-
-
Save jugyo/123535 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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