Class: DatabasePlumber::LeakFinder
- Inherits:
-
Object
- Object
- DatabasePlumber::LeakFinder
- Defined in:
- lib/database_plumber/leak_finder.rb
Defined Under Namespace
Classes: InvalidModelError
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options) ⇒ LeakFinder
constructor
A new instance of LeakFinder.
- #inspect ⇒ Object
Constructor Details
#initialize(options) ⇒ LeakFinder
Returns a new instance of LeakFinder.
12 13 14 15 16 |
# File 'lib/database_plumber/leak_finder.rb', line 12 def initialize() @ignored_models = ([:ignored_models] || []) + IGNORED_AR_INTERNALS @ignored_adapters = [:ignored_adapters] || [] @model_thresholds = [:model_thresholds] || {} end |
Class Method Details
.inspect(options = {}) ⇒ Object
8 9 10 |
# File 'lib/database_plumber/leak_finder.rb', line 8 def self.inspect( = {}) new().inspect end |
Instance Method Details
#inspect ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/database_plumber/leak_finder.rb', line 18 def inspect filtered_models.each_with_object({}) do |model, results| records = count_for(model) if records > threshold_for(model) results[model.to_s] = records mop_up(model) end results end end |