Class: Bullet::Notification::NPlusOneQuery
- Inherits:
-
Base
- Object
- Base
- Bullet::Notification::NPlusOneQuery
show all
- Defined in:
- lib/bullet/notification/n_plus_one_query.rb
Instance Attribute Summary
Attributes inherited from Base
#associations, #base_class, #notifier, #path
Instance Method Summary
collapse
Methods inherited from Base
#eql?, #full_notice, #hash, #notify_inline, #notify_out_of_channel, #standard_notice
Constructor Details
#initialize(callers, base_class, associations, path = nil) ⇒ NPlusOneQuery
4
5
6
7
8
|
# File 'lib/bullet/notification/n_plus_one_query.rb', line 4
def initialize( callers, base_class, associations, path = nil )
super( base_class, associations, path )
@callers = callers
end
|
Instance Method Details
#body ⇒ Object
14
15
16
|
# File 'lib/bullet/notification/n_plus_one_query.rb', line 14
def body
"#{klazz_associations_str}\n Add to your finder: #{associations_str}"
end
|
#body_with_caller ⇒ Object
10
11
12
|
# File 'lib/bullet/notification/n_plus_one_query.rb', line 10
def body_with_caller
"#{body}\n#{call_stack_messages}"
end
|
#title ⇒ Object
18
19
20
|
# File 'lib/bullet/notification/n_plus_one_query.rb', line 18
def title
"N+1 Query #{@path ? "in #{@path}" : 'detected'}"
end
|