Class: Bullet::Notification::NPlusOneQuery
- Defined in:
- lib/bullet/notification/n_plus_one_query.rb
Instance Attribute Summary
Attributes inherited from Base
#associations, #base_class, #notifier, #path, #url
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(callers, base_class, associations, path = nil) ⇒ NPlusOneQuery
constructor
A new instance of NPlusOneQuery.
- #notification_data ⇒ Object
- #title ⇒ Object
Methods inherited from Base
#body_with_caller, #eql?, #hash, #notify_inline, #notify_out_of_channel, #short_notice, #whoami
Constructor Details
#initialize(callers, base_class, associations, path = nil) ⇒ NPlusOneQuery
Returns a new instance of NPlusOneQuery.
6 7 8 9 10 |
# 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 |
Instance Method Details
#body ⇒ Object
12 13 14 |
# 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 ⇒ Object
20 21 22 |
# File 'lib/bullet/notification/n_plus_one_query.rb', line 20 def notification_data super.merge(backtrace: []) end |
#title ⇒ Object
16 17 18 |
# File 'lib/bullet/notification/n_plus_one_query.rb', line 16 def title "USE eager loading #{@path ? "in #{@path}" : 'detected'}" end |