Sha256: 297575663ab5b1b2e2921f586ee390a982bf5e7c84d55d9466dd6ef6b97dfc26

Contents?: true

Size: 369 Bytes

Versions: 12

Compression:

Stored size: 369 Bytes

Contents

# frozen_string_literal: true

module RailsMiniProfiler
  class RenderTemplateTracePresenter < TracePresenter
    def label
      root = Rails.root.to_s.split('/').to_set
      identifier = model.identifier.split('/').to_set
      (root ^ identifier).drop(2).join('/').reverse.truncate(30).reverse
    end

    def description
      "Render #{label}"
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rails_mini_profiler-0.7.0 app/presenters/rails_mini_profiler/render_template_trace_presenter.rb
rails_mini_profiler-0.6.0 app/presenters/rails_mini_profiler/render_template_trace_presenter.rb
rails_mini_profiler-0.5.0 app/presenters/rails_mini_profiler/render_template_trace_presenter.rb
rails_mini_profiler-0 app/presenters/rails_mini_profiler/render_template_trace_presenter.rb
rails_mini_profiler-0.4.0 app/presenters/rails_mini_profiler/render_template_trace_presenter.rb
rails_mini_profiler-0.3.0 app/presenters/rails_mini_profiler/render_template_trace_presenter.rb
rails_mini_profiler-0.2.1 app/presenters/rails_mini_profiler/render_template_trace_presenter.rb
rails_mini_profiler-0.2.0 app/presenters/rails_mini_profiler/render_template_trace_presenter.rb
rails_mini_profiler-0.1.3 app/presenters/rails_mini_profiler/render_template_trace_presenter.rb
rails_mini_profiler-0.1.2 app/presenters/rails_mini_profiler/render_template_trace_presenter.rb
rails_mini_profiler-0.1.1 app/presenters/rails_mini_profiler/render_template_trace_presenter.rb
rails_mini_profiler-0.1.0 app/presenters/rails_mini_profiler/render_template_trace_presenter.rb