Class: Dread::MissingGraphs

Inherits:
Object
  • Object
show all
Defined in:
lib/dread/missing_graphs.rb

Instance Method Summary collapse

Constructor Details

#initializeMissingGraphs

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_dependablesObject



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

#drawObject



17
18
19
# File 'lib/dread/missing_graphs.rb', line 17

def draw
  ConsoleOutput.generate_missing(all_missing_dependables)
end