Sha256: 59e718017b4c11310e485ef3160f226e33995d59570ef4abb71e90e66957b9a1

Contents?: true

Size: 861 Bytes

Versions: 2

Compression:

Stored size: 861 Bytes

Contents

::ActionView::TemplateRenderer.class_eval do
  alias_method :render_with_layout_without_tracebin, :render_with_layout

  def render_with_layout(path, locals, *args, &block)
    layout = nil

    if path
      if method(:find_layout).arity == 3
        layout = find_layout(path, locals.keys, [formats.first])
      else
        layout = find_layout(path, locals.keys)
      end
    end

    if layout
      start_time = Time.now
      render_with_layout_without_tracebin(path, locals, *args, &block)
      end_time = Time.new

      event_data = [
        'render_layout.action_view',
        start_time,
        end_time,
        {
          identifier: layout.identifier
        }
      ]

      ::Tracebin::Patches.handle_event :action_view_layout, event_data
    else
      render_with_layout_without_tracebin(path, locals, *args, &block)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tracebin-0.0.9 lib/tracebin/patches/action_view_layout.rb
tracebin-0.0.8 lib/tracebin/patches/action_view_layout.rb