Sha256: 2e1e9b25a0706baf60182d31cb87322cc2db7e72cedc841998e3463d4a488ca4

Contents?: true

Size: 650 Bytes

Versions: 1

Compression:

Stored size: 650 Bytes

Contents

module Bullet
  module Notification
    class UnusedEagerLoading < Base
      def initialize(callers, base_class, associations, path = nil)
        super(base_class, associations, path)

        @callers = callers
      end

      def body
        "#{klazz_associations_str}\n  Remove from your finder: #{associations_str}"
      end

      def title
        "AVOID eager loading #{@path ? "in #{@path}" : 'detected'}"
      end

      def notification_data
        super.merge(
            backtrace: []
        )
      end

      protected

      def call_stack_messages
        (['Call stack'] + @callers).join("\n  ")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bullet-5.7.1 lib/bullet/notification/unused_eager_loading.rb