class Bullet::Notification::NPlusOneQuery
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/n_plus_one_query.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/n_plus_one_query.rb, line 12 def body "#{klazz_associations_str}\n Add to your query: #{associations_str}" end
notification_data()
click to toggle source
Calls superclass method
Bullet::Notification::Base#notification_data
# File lib/bullet/notification/n_plus_one_query.rb, line 20 def notification_data super.merge(backtrace: []) end
title()
click to toggle source
# File lib/bullet/notification/n_plus_one_query.rb, line 16 def title "USE eager loading #{@path ? "in #{@path}" : 'detected'}" end
Protected Instance Methods
call_stack_messages()
click to toggle source
# File lib/bullet/notification/n_plus_one_query.rb, line 26 def call_stack_messages (['Call stack'] + @callers).join("\n ") end