Sha256: eba90aee6c2f0656df422885227795bdc9233b0a9e7f10f63c4dccb705000aeb

Contents?: true

Size: 465 Bytes

Versions: 5

Compression:

Stored size: 465 Bytes

Contents

# frozen_string_literal: true

module Jiminy
  module Recording
    module TestControllerConcern
      extend ActiveSupport::Concern

      included do
        around_action :_test_n_plus_one_detection
      end

      private

        def _test_n_plus_one_detection
          yield and return if Prosopite.scan?

          begin
            Prosopite.scan
            yield
          ensure
            Prosopite.finish
          end
        end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
jiminy-0.4.0 lib/jiminy/recording/test_controller_concern.rb
jiminy-0.3.0 lib/jiminy/recording/test_controller_concern.rb
jiminy-0.2.0 lib/jiminy/recording/test_controller_concern.rb
jiminy-0.1.1 lib/jiminy/recording/test_controller_concern.rb
jiminy-0.1.0 lib/jiminy/recording/test_controller_concern.rb