Class: WhoAmI::Function::AnnotateModels

Inherits:
Object
  • Object
show all
Includes:
ProcParty
Defined in:
lib/who_am_i/function/annotate_models.rb

Instance Method Summary collapse

Constructor Details

#initialize(config, tables) ⇒ AnnotateModels

Returns a new instance of AnnotateModels.



6
7
8
9
# File 'lib/who_am_i/function/annotate_models.rb', line 6

def initialize(config, tables)
  @config = config
  @tables = tables
end

Instance Method Details

#callObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/who_am_i/function/annotate_models.rb', line 11

def call
  paths
    .flat_map(&Ls.new)
    .flat_map(&ParseModel.new)
    .tap(&ExtractModelData.new)
    .select(&:activerecord?)
    .reject(&:abstract_class?)
    .each(&ResolveTable.new(@tables))
    .reject(&:skipped?)
    .each(&ComputeComment.new)
    .reject(&:skipped?)
    .each(&ComputeContent.new)
    .reject(&:skipped?)
    .each(&WriteModel.new)
end