From 731d4392e478ff5526b595074d9caa999da8bd0c Mon Sep 17 00:00:00 2001 From: Justin George Date: Tue, 27 Apr 2010 21:16:06 -0700 Subject: Change event namespace ordering to most-significant first [#4504 state:resolved] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit More work still needs to be done on some of these names (render_template.action_view and render_template!.action_view particularly) but this allows (for example) /^sql/ to subscribe to all the various ORMs without further modification Signed-off-by: José Valim --- railties/lib/rails/log_subscriber.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'railties/lib') diff --git a/railties/lib/rails/log_subscriber.rb b/railties/lib/rails/log_subscriber.rb index 42697d2e32..145c7e0ace 100644 --- a/railties/lib/rails/log_subscriber.rb +++ b/railties/lib/rails/log_subscriber.rb @@ -22,7 +22,7 @@ module Rails # # Rails::LogSubscriber.add :active_record, ActiveRecord::Railtie::LogSubscriber.new # - # So whenever a "active_record.sql" notification arrive to Rails::LogSubscriber, + # So whenever a "sql.active_record" notification arrive to Rails::LogSubscriber, # it will properly dispatch the event (ActiveSupport::Notifications::Event) to # the sql method. # @@ -54,7 +54,7 @@ module Rails log_subscribers << log_subscriber log_subscriber.public_methods(false).each do |event| - notifier.subscribe("#{namespace}.#{event}") do |*args| + notifier.subscribe("#{event}.#{namespace}") do |*args| next if log_subscriber.logger.nil? begin @@ -105,4 +105,4 @@ module Rails "#{bold}#{color}#{text}#{CLEAR}" end end -end \ No newline at end of file +end -- cgit v1.2.3