Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: fe27d114ed
Fetching contributors…

Cannot retrieve contributors at this time

23 lines (16 sloc) 0.351 kb
#!/usr/bin/ruby
# Sources :
# http://rbjl.net/49-railsrc-rails-console-snippets
def change_log(stream)
ActiveRecord::Base.logger = Logger.new(stream)
ActiveRecord::Base.clear_active_connections!
end
def show_log
change_log(STDOUT)
end
def hide_log
change_log(nil)
end
def sql(query)
ActiveRecord::Base.connection.select_all(query)
end
Jump to Line
Something went wrong with that request. Please try again.