class Kaminari::Helpers::PaginationRenderer

The main class that controlls the whole process

Private Instance Methods

suppress_logging_render_partial(&blk) click to toggle source

dirty hack

# File lib/kaminari/helpers/helpers.rb, line 56
def suppress_logging_render_partial(&blk)
  if subscriber = ActionView::LogSubscriber.log_subscribers.detect {|ls| ls.is_a? ActionView::LogSubscriber}
    class << subscriber
      alias_method :render_partial_with_logging, :render_partial
      # do nothing
      def render_partial(event); end
    end
    ret = blk.call
    class << subscriber
      alias_method :render_partial, :render_partial_with_logging
      undef :render_partial_with_logging
    end
    ret
  else
    blk.call
  end
end