Class: GraniteGenerator

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

Instance Method Summary collapse

Instance Method Details

#create_actionObject



7
8
9
10
11
12
13
# File 'lib/generators/granite_generator.rb', line 7

def create_action
  template 'granite_action.rb.erb', "apq/actions/ba/#{file_path}.rb"
  template 'granite_business_action.rb.erb', "apq/actions/ba/#{class_path.join('/')}/business_action.rb" unless options.collection?
  template 'granite_base_action.rb.erb', 'apq/actions/base_action.rb', skip: true
  template 'granite_action_spec.rb.erb', "spec/apq/actions/ba/#{file_path}_spec.rb"
  empty_directory "apq/actions/ba/#{file_path}/#{projector}" if projector
end