From 6fbe9ef2ffb1858027130789246f3ae24a0a182f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sun, 3 Jan 2010 20:39:42 +0100 Subject: Use namespaces in notifications. --- actionpack/lib/action_view/render/rendering.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'actionpack/lib/action_view/render/rendering.rb') diff --git a/actionpack/lib/action_view/render/rendering.rb b/actionpack/lib/action_view/render/rendering.rb index 48316cac53..578cfe1177 100644 --- a/actionpack/lib/action_view/render/rendering.rb +++ b/actionpack/lib/action_view/render/rendering.rb @@ -93,7 +93,7 @@ module ActionView def _render_template(template, layout = nil, options = {}) locals = options[:locals] || {} - content = ActiveSupport::Notifications.instrument(:render_template, + content = ActiveSupport::Notifications.instrument("actionview.render_template", :identifier => template.identifier, :layout => (layout ? layout.identifier : nil)) do template.render(self, locals) end @@ -109,7 +109,8 @@ module ActionView end def _render_layout(layout, locals, &block) - ActiveSupport::Notifications.instrument(:render_layout, :identifier => layout.identifier) do + ActiveSupport::Notifications.instrument("actionview.render_layout", + :identifier => layout.identifier) do layout.render(self, locals){ |*name| _layout_for(*name, &block) } end end -- cgit v1.2.3 From 3990310a2bedd0dff5753e3e9b1282e686cff0cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Mon, 4 Jan 2010 00:03:56 +0100 Subject: Use underscore in notification namespaces. --- actionpack/lib/action_view/render/rendering.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack/lib/action_view/render/rendering.rb') diff --git a/actionpack/lib/action_view/render/rendering.rb b/actionpack/lib/action_view/render/rendering.rb index 578cfe1177..2fdfad694d 100644 --- a/actionpack/lib/action_view/render/rendering.rb +++ b/actionpack/lib/action_view/render/rendering.rb @@ -93,7 +93,7 @@ module ActionView def _render_template(template, layout = nil, options = {}) locals = options[:locals] || {} - content = ActiveSupport::Notifications.instrument("actionview.render_template", + content = ActiveSupport::Notifications.instrument("action_view.render_template", :identifier => template.identifier, :layout => (layout ? layout.identifier : nil)) do template.render(self, locals) end @@ -109,7 +109,7 @@ module ActionView end def _render_layout(layout, locals, &block) - ActiveSupport::Notifications.instrument("actionview.render_layout", + ActiveSupport::Notifications.instrument("action_view.render_layout", :identifier => layout.identifier) do layout.render(self, locals){ |*name| _layout_for(*name, &block) } end -- cgit v1.2.3 From a5a9156b4ebab1e0f441b584f86be7380b21353b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Fri, 15 Jan 2010 12:23:13 +0100 Subject: Template rendering should include layout time. --- actionpack/lib/action_view/render/rendering.rb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'actionpack/lib/action_view/render/rendering.rb') diff --git a/actionpack/lib/action_view/render/rendering.rb b/actionpack/lib/action_view/render/rendering.rb index 2fdfad694d..d2f28f7e38 100644 --- a/actionpack/lib/action_view/render/rendering.rb +++ b/actionpack/lib/action_view/render/rendering.rb @@ -93,19 +93,19 @@ module ActionView def _render_template(template, layout = nil, options = {}) locals = options[:locals] || {} - content = ActiveSupport::Notifications.instrument("action_view.render_template", - :identifier => template.identifier, :layout => (layout ? layout.identifier : nil)) do - template.render(self, locals) - end + ActiveSupport::Notifications.instrument("action_view.render_template", + :identifier => template.identifier, :layout => layout.try(:identifier)) do - @_content_for[:layout] = content + content = template.render(self, locals) + @_content_for[:layout] = content - if layout - @_layout = layout.identifier - content = _render_layout(layout, locals) - end + if layout + @_layout = layout.identifier + content = _render_layout(layout, locals) + end - content + content + end end def _render_layout(layout, locals, &block) -- cgit v1.2.3 From e5a2a9fced3e5559ac139977922a0f63a53c6c5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Fri, 15 Jan 2010 14:45:18 +0100 Subject: Remove URI object from ActiveResource notification, send the :mailer class in AM (like in AP#process_action) and remove locale instrumentation. --- actionpack/lib/action_view/render/rendering.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'actionpack/lib/action_view/render/rendering.rb') diff --git a/actionpack/lib/action_view/render/rendering.rb b/actionpack/lib/action_view/render/rendering.rb index d2f28f7e38..ec278ca783 100644 --- a/actionpack/lib/action_view/render/rendering.rb +++ b/actionpack/lib/action_view/render/rendering.rb @@ -109,10 +109,7 @@ module ActionView end def _render_layout(layout, locals, &block) - ActiveSupport::Notifications.instrument("action_view.render_layout", - :identifier => layout.identifier) do - layout.render(self, locals){ |*name| _layout_for(*name, &block) } - end + layout.render(self, locals){ |*name| _layout_for(*name, &block) } end end end -- cgit v1.2.3