Class: Domain::Generators::CommandGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Domain::Generators::CommandGenerator
- Defined in:
- lib/rails_domain_model/generators/command/command_generator.rb
Instance Method Summary collapse
Instance Method Details
#copy_files ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/rails_domain_model/generators/command/command_generator.rb', line 8 def copy_files @context = class_path.first @klass = file_name command_file = "domain_model/domain/#{@context}/commands/#{@klass}.rb" template "command.rb", command_file if !File.exists?('domain_model/domain_command.rb') template 'domain_command.rb', 'domain_model/domain_command.rb' end application do "config.paths.add 'domain_model', eager_load: true" end end |