Class: Sequel::Generators::ModelGenerator

Inherits:
Base
  • Object
show all
Defined in:
lib/generators/sequel/model/model_generator.rb

Instance Method Summary collapse

Methods inherited from Base

base_name, next_migration_number, source_root

Instance Method Details

#create_migration_fileObject



14
15
16
17
18
19
20
# File 'lib/generators/sequel/model/model_generator.rb', line 14

def create_migration_file
  return unless options[:migration]
  migration_template(
    'migration.rb.erb',
    File.join('db', 'migrate', "create_#{table_name}.rb")
  )
end

#create_model_fileObject



22
23
24
25
26
27
# File 'lib/generators/sequel/model/model_generator.rb', line 22

def create_model_file
  template(
    'model.rb.erb',
    File.join('app', 'models', class_path, "#{file_name}.rb")
  )
end