Sha256: d3ab5d711deea8c995f178a4cf248abe28540af4c08e1ec511810fe1169ac713

Contents?: true

Size: 1.55 KB

Versions: 43

Compression:

Stored size: 1.55 KB

Contents

# Copyright (c) 2013 AppNeta, Inc.
# All rights reserved.

if defined?(ActionView::Base) && Oboe::Config[:action_view][:enabled]

  if Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR == 0

    ActionView::Partials::PartialRenderer.class_eval do
      alias :render_partial_without_oboe :render_partial
      def render_partial(object = @object)
        entry_kvs = {}
        begin
          name  = Oboe::Util.prettify(@options[:partial]) if @options.is_a?(Hash)
          entry_kvs[:FunctionName] = :render_partial
          entry_kvs[:Class]        = :PartialRenderer
          entry_kvs[:Module]       = 'ActionView::Partials'
          entry_kvs[:File]         = __FILE__
          entry_kvs[:LineNumber]   = __LINE__
        rescue
        end

        Oboe::API.profile(name, entry_kvs, Oboe::Config[:action_view][:collect_backtraces]) do
          render_partial_without_oboe(object)
        end
      end

      alias :render_collection_without_oboe :render_collection
      def render_collection
        entry_kvs = {}
        begin
          name  = Oboe::Util.prettify(@path)
          entry_kvs[:FunctionName] = :render_collection
          entry_kvs[:Class]        = :PartialRenderer
          entry_kvs[:Module]       = 'ActionView::Partials'
          entry_kvs[:File]         = __FILE__
          entry_kvs[:LineNumber]   = __LINE__
        rescue
        end

        Oboe::API.profile(name, entry_kvs, Oboe::Config[:action_view][:collect_backtraces]) do
          render_collection_without_oboe
        end
      end
    end
  end
end

# vim:set expandtab:tabstop=2

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
oboe-2.7.2.fuchs1 lib/oboe/frameworks/rails/inst/action_view_30.rb
oboe-2.7.2.2-java lib/oboe/frameworks/rails/inst/action_view_30.rb
oboe-2.7.2.2 lib/oboe/frameworks/rails/inst/action_view_30.rb