Class: RecordHistory::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#create_migration_fileObject



14
15
16
17
18
19
20
21
22
# File 'lib/generators/record_history/install_generator.rb', line 14

def create_migration_file
  %w/create_record_histories alter_record_histories_add_transaction_id/.each do |f|
    begin
      migration_template "#{f}.rb", "db/migrate/#{f}.rb"
    rescue Rails::Generators::Error => e
      puts e.message
    end
  end
end