class Domain::Generators::EventGenerator

Public Instance Methods

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

  command_file = "domain_model/domain/#{@context}/events/#{@klass}.rb"
  template "event.rb", command_file

  if !File.exists?('domain_model/domain_event.rb')
    template 'domain_event.rb', 'domain_model/domain_event.rb'
  end

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