class Domain::Generators::AggregateGenerator

Public Instance Methods

copy_files() click to toggle source
# File lib/rails_domain_model/generators/aggregate/aggregate_generator.rb, line 8
def copy_files
  @context = class_path.first
  @klass = file_name

  aggregate_file = "domain_model/domain/#{@context}/#{@klass}.rb"

  template "aggregate.rb", aggregate_file
  if !File.exists?('domain_model/domain_aggregate.rb')
    template 'domain_aggregate.rb', 'domain_model/domain_aggregate.rb'
  end

  application do
    "config.paths.add 'domain_model', eager_load: true"
  end
end