Skip to content

Instantly share code, notes, and snippets.

@zhengjia
Created May 4, 2010 22:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhengjia/390117 to your computer and use it in GitHub Desktop.
Save zhengjia/390117 to your computer and use it in GitHub Desktop.
sql log
~/.irbrc
if rails_env = ENV['RAILS_ENV']
# Called after the irb session is initialized and Rails has
# been loaded (props: Mike Clark).
IRB.conf[:IRB_RC] = Proc.new do
ActiveRecord::Base.logger = Logger.new(STDOUT)
ActiveRecord::Base.instance_eval { alias :[] :find }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment