Sha256: 51e7d87e4cf0b2fb5b6177a024973119222931fcee20d7cdc69e4dd1881ea0b3

Contents?: true

Size: 646 Bytes

Versions: 4

Compression:

Stored size: 646 Bytes

Contents

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

        @callers = callers
      end

      def body
        "#{klazz_associations_str}\n  Add to your finder: #{associations_str}"
      end

      def title
        "USE 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

4 entries across 4 versions & 1 rubygems

Version Path
bullet-5.6.1 lib/bullet/notification/n_plus_one_query.rb
bullet-5.6.0 lib/bullet/notification/n_plus_one_query.rb
bullet-5.5.1 lib/bullet/notification/n_plus_one_query.rb
bullet-5.5.0 lib/bullet/notification/n_plus_one_query.rb