Class: Dread::MissingGraphs
- Inherits:
-
Object
- Object
- Dread::MissingGraphs
- Defined in:
- lib/dread/missing_graphs.rb
Instance Method Summary collapse
- #all_missing_dependables ⇒ Object
- #draw ⇒ Object
-
#initialize ⇒ MissingGraphs
constructor
A new instance of MissingGraphs.
Constructor Details
#initialize ⇒ MissingGraphs
Returns a new instance of MissingGraphs.
4 5 6 |
# File 'lib/dread/missing_graphs.rb', line 4 def initialize Rails.application.eager_load! end |
Instance Method Details
#all_missing_dependables ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/dread/missing_graphs.rb', line 8 def all_missing_dependables Dread.ar_models.map do |active_record_model| missing_dependables = Dread::MissingGraph.new(active_record_model.to_s) .missing_dependables { active_record_model => missing_dependables } if missing_dependables.any? end.compact.inject {|element, all| all.merge(element)} end |
#draw ⇒ Object
17 18 19 |
# File 'lib/dread/missing_graphs.rb', line 17 def draw ConsoleOutput.generate_missing(all_missing_dependables) end |