Sha256: de7833ab3ded74b19bc180c3cb4b7b28a412376a7237a1edd35dbb0353edc7bd

Contents?: true

Size: 558 Bytes

Versions: 5

Compression:

Stored size: 558 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
        "N+1 Query #{@path ? "in #{@path}" : 'detected'}"
      end

      protected
        def call_stack_messages
          (['N+1 Query method call stack'] + @callers).join( "\n  " )
        end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bullet-4.14.4 lib/bullet/notification/n_plus_one_query.rb
bullet-4.14.3 lib/bullet/notification/n_plus_one_query.rb
bullet-4.14.2 lib/bullet/notification/n_plus_one_query.rb
bullet-4.14.0 lib/bullet/notification/n_plus_one_query.rb
bullet-4.13.2 lib/bullet/notification/n_plus_one_query.rb