Class: Bullet::Detector::NPlusOneQuery
- Inherits:
-
Association
- Object
- Base
- Association
- Bullet::Detector::NPlusOneQuery
- Defined in:
- lib/bullet/detector/n_plus_one_query.rb
Class Method Summary collapse
-
.call_association(object, associations) ⇒ Object
executed when object.assocations is called.
Methods inherited from Association
add_call_object_associations, add_eager_loadings, add_impossible_object, add_object_associations, add_possible_objects, clear, start_request
Methods inherited from Base
Class Method Details
.call_association(object, associations) ⇒ Object
executed when object.assocations is called. first, it keeps this method call for object.association. then, it checks if this associations call is unpreload.
if it is, keeps this unpreload associations and caller.
8 9 10 11 12 13 14 15 16 |
# File 'lib/bullet/detector/n_plus_one_query.rb', line 8 def self.call_association(object, associations) @@checked = true add_call_object_associations(object, associations) if conditions_met?(object, associations) caller_in_project create_notification object.class, associations end end |