Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[irbrc] rails 3 already logs queries in irb by itself

  • Loading branch information...
commit 0bdbe24f5f75729380731650279e58cb3132a45d 1 parent f61fab6
@sickill authored
Showing with 0 additions and 14 deletions.
  1. +0 −14 .irbrc
View
14 .irbrc
@@ -63,20 +63,6 @@ def ls(obj=self)
end
end
-# Just for Rails3
-if defined?(ActiveSupport::Notifications)
- $odd_or_even_queries = false
- ActiveSupport::Notifications.subscribe('sql.active_record') do |*args|
- $odd_or_even_queries = !$odd_or_even_queries
- color = $odd_or_even_queries ? "\e[36m" : "\e[35m"
- event = ActiveSupport::Notifications::Event.new(*args)
- time = "%.1fms" % event.duration
- name = event.payload[:name]
- sql = event.payload[:sql].gsub("\n", " ").squeeze(" ")
- puts " \e[1m#{color}#{name} (#{time})\e[0m #{sql}"
- end
-end
-
def mix_colors(c1, c2)
c1.sub!('#')
c2.sub!('#')

0 comments on commit 0bdbe24

Please sign in to comment.
Something went wrong with that request. Please try again.