Class: Stonepath::Generators::WorkitemModelGenerator

Inherits:
Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/stonepath/workitem_model/workitem_model_generator.rb

Instance Method Summary collapse

Methods inherited from Base

source_root

Instance Method Details

#create_migrationObject



14
15
16
# File 'lib/generators/stonepath/workitem_model/workitem_model_generator.rb', line 14

def create_migration
  migration_template 'migration.rb', "db/migrate/create_#{file_name.pluralize}.rb"
end

#create_model_fileObject



10
11
12
# File 'lib/generators/stonepath/workitem_model/workitem_model_generator.rb', line 10

def create_model_file
  template('model.rb', "app/models/#{file_name}.rb") if valid_model_name?(file_name)
end