Module: PredictiveLoad::ActiveRecordCollectionObservation::UnscopedTracker
- Defined in:
- lib/predictive_load/active_record_collection_observation.rb
Overview
disable eager loading since includes + unscoped is broken on rails 4
Instance Method Summary collapse
Instance Method Details
#predictive_load_disabled ⇒ Object
61 62 63 |
# File 'lib/predictive_load/active_record_collection_observation.rb', line 61 def predictive_load_disabled Thread.current[:predictive_load_disabled] ||= [] end |
#unscoped ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/predictive_load/active_record_collection_observation.rb', line 48 def unscoped if block_given? begin predictive_load_disabled << self super ensure predictive_load_disabled.pop end else super end end |