Class: Dolar::Bna::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/dolar/bna/install/install_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(path) ⇒ Object



12
13
14
15
# File 'lib/generators/dolar/bna/install/install_generator.rb', line 12

def self.next_migration_number(path)
  next_migration_number = current_migration_number(path) + 1
  ActiveRecord::Migration.next_migration_number(next_migration_number)
end

Instance Method Details

#copy_migrationsObject



17
18
19
20
21
22
# File 'lib/generators/dolar/bna/install/install_generator.rb', line 17

def copy_migrations
  if !ActiveRecord::Base.table_exists?("dolar_cotizations")
    migration_template "create_dolar_cotizations.rb",
      "db/migrate/create_dolar_cotizations.rb"
  end
end