Class: NexusCqrs::QueryGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/nexus_cqrs/query_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_query_fileObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/generators/nexus_cqrs/query_generator.rb', line 9

def copy_query_file
  file_path = class_name.underscore

  @permission = options['permission']

  template('query.rb', "app/domain/queries/#{file_path}.rb")
  template('query_handler.rb', "app/domain/queries/#{file_path}_handler.rb")

  register_query
end