Sha256: 1d04f5d2ab81d825dd5fd3dfc05e172cca10843c9fb4651e1188e0a137460115

Contents?: true

Size: 646 Bytes

Versions: 24

Compression:

Stored size: 646 Bytes

Contents

# frozen_string_literal: true

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 query: #{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

24 entries across 24 versions & 1 rubygems

Version Path
bullet-8.0.1 lib/bullet/notification/n_plus_one_query.rb
bullet-8.0.0 lib/bullet/notification/n_plus_one_query.rb
bullet-7.2.0 lib/bullet/notification/n_plus_one_query.rb
bullet-7.1.6 lib/bullet/notification/n_plus_one_query.rb
bullet-7.1.5 lib/bullet/notification/n_plus_one_query.rb
bullet-7.1.4 lib/bullet/notification/n_plus_one_query.rb
bullet-7.1.3 lib/bullet/notification/n_plus_one_query.rb
bullet-7.1.2 lib/bullet/notification/n_plus_one_query.rb
bullet-7.1.1 lib/bullet/notification/n_plus_one_query.rb
bullet-7.1.0 lib/bullet/notification/n_plus_one_query.rb
bullet-7.0.7 lib/bullet/notification/n_plus_one_query.rb
bullet-7.0.6 lib/bullet/notification/n_plus_one_query.rb
bullet-7.0.5 lib/bullet/notification/n_plus_one_query.rb
bullet-7.0.4 lib/bullet/notification/n_plus_one_query.rb
bullet-7.0.3 lib/bullet/notification/n_plus_one_query.rb
bullet-7.0.2 lib/bullet/notification/n_plus_one_query.rb
bullet-7.0.1 lib/bullet/notification/n_plus_one_query.rb
bullet-7.0.0 lib/bullet/notification/n_plus_one_query.rb
bullet-6.1.5 lib/bullet/notification/n_plus_one_query.rb
bullet-6.1.4 lib/bullet/notification/n_plus_one_query.rb