Class: Deimos::Generators::ActiveRecordGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Extended by:
ActiveRecord::Generators::Migration
Includes:
ActiveRecord::Generators::Migration, Rails::Generators::Migration
Defined in:
lib/generators/deimos/active_record_generator.rb

Overview

Generator for ActiveRecord model and migration.

Instance Method Summary collapse

Instance Method Details

#generateObject

:nodoc:



73
74
75
76
# File 'lib/generators/deimos/active_record_generator.rb', line 73

def generate
  migration_template('migration.rb', "db/migrate/create_#{table_name.underscore}.rb")
  template('model.rb', "app/models/#{table_name.underscore.singularize}.rb")
end