Class: Diesel::Generators::InstallBase

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

engine, engine_name, engine_root, source_root, template_root

Class Method Details

.inherited(generator) ⇒ Object



20
21
22
23
# File 'lib/diesel/generators/install_base.rb', line 20

def self.inherited(generator)
  super
  generator.desc %{Generate configuration, migration, and other essential files.}
end

Instance Method Details

#generate_migrationsObject



11
12
13
14
15
16
17
18
# File 'lib/diesel/generators/install_base.rb', line 11

def generate_migrations
  migrations.each do |source_file|
    name = migration_name(source_file)
    unless migration_exists?(name)
      migration_template source_file, "db/migrate/#{name}"
    end
  end
end