class Bullet::Notification::UnusedEagerLoading

Public Class Methods

new(callers, base_class, associations, path = nil) click to toggle source
Calls superclass method Bullet::Notification::Base::new
# File lib/bullet/notification/unused_eager_loading.rb, line 6
def initialize(callers, base_class, associations, path = nil)
  super(base_class, associations, path)

  @callers = callers
end

Public Instance Methods

body() click to toggle source
# File lib/bullet/notification/unused_eager_loading.rb, line 12
def body
  "#{klazz_associations_str}\n  Remove from your finder: #{associations_str}"
end
notification_data() click to toggle source
# File lib/bullet/notification/unused_eager_loading.rb, line 20
def notification_data
  super.merge(
    backtrace: []
  )
end
title() click to toggle source
# File lib/bullet/notification/unused_eager_loading.rb, line 16
def title
  "AVOID eager loading #{@path ? "in #{@path}" : 'detected'}"
end

Protected Instance Methods

call_stack_messages() click to toggle source
# File lib/bullet/notification/unused_eager_loading.rb, line 28
def call_stack_messages
  (['Call stack'] + @callers).join("\n  ")
end