Sha256: 2dca9d17480d89b24ac14e1542f925e374c042c5aaba063d85140a1d230eb59f

Contents?: true

Size: 623 Bytes

Versions: 6

Compression:

Stored size: 623 Bytes

Contents

# frozen_string_literal: true

require 'action_view/log_subscriber'
require 'action_view/context'

require 'kaminari/helpers/paginator'

module Kaminari
  # = Helpers
  module ActionViewExtension
    # Monkey-patching AV::LogSubscriber not to log each render_partial
    module LogSubscriberSilencer
      def render_partial(*)
        super unless Thread.current[:kaminari_rendering]
      end
    end
  end
end

# so that this instance can actually "render"
::Kaminari::Helpers::Paginator.send :include, ::ActionView::Context

ActionView::LogSubscriber.send :prepend, Kaminari::ActionViewExtension::LogSubscriberSilencer

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/kaminari-actionview-1.2.2/lib/kaminari/actionview/action_view_extension.rb
kaminari-actionview-1.2.2 lib/kaminari/actionview/action_view_extension.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/kaminari-actionview-1.2.1/lib/kaminari/actionview/action_view_extension.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/kaminari-actionview-1.2.1/lib/kaminari/actionview/action_view_extension.rb
kaminari-actionview-1.2.1 lib/kaminari/actionview/action_view_extension.rb
kaminari-actionview-1.2.0 lib/kaminari/actionview/action_view_extension.rb