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.



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

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

Instance Method Details

#copy_view_filesObject



34
35
36
37
38
39
40
41
# File 'lib/generators/aws_record/erb/erb_generator.rb', line 34

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



30
31
32
# File 'lib/generators/aws_record/erb/erb_generator.rb', line 30

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