Class: AwsRecord::Generators::ErbGenerator

Inherits:
Base
  • Object
show all
Includes:
Rails::Generators::ResourceHelpers
Defined in:
lib/generators/aws_record/erb/erb_generator.rb

Instance Attribute Summary

Attributes inherited from Base

#gsi_rw_units, #gsis, #length_validations, #primary_read_units, #primary_write_units, #required_attrs

Instance Method Summary collapse

Constructor Details

#initialize(args, *options) ⇒ ErbGenerator

Returns a new instance of ErbGenerator.



14
15
16
17
# File 'lib/generators/aws_record/erb/erb_generator.rb', line 14

def initialize(args, *options)
  options[0] << '--skip-table-config'
  super
end

Instance Method Details

#copy_view_filesObject



23
24
25
26
27
28
29
30
# File 'lib/generators/aws_record/erb/erb_generator.rb', line 23

def copy_view_files
  available_views.each do |view|
    formats.each do |format|
      filename = filename_with_extensions(view, format)
      template filename, File.join('app/views', controller_file_path, filename)
    end
  end
end

#create_root_folderObject



19
20
21
# File 'lib/generators/aws_record/erb/erb_generator.rb', line 19

def create_root_folder
  empty_directory File.join('app/views', controller_file_path)
end