Class: Passkit::Generators::InstallGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(dirname) ⇒ Object

Implement the required interface for Rails::Generators::Migration.



14
15
16
17
# File 'lib/generators/passkit/install_generator.rb', line 14

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

Instance Method Details

#generate_filesObject



20
21
22
23
# File 'lib/generators/passkit/install_generator.rb', line 20

def generate_files
  migration_template "create_passkit_tables.rb", "db/migrate/create_passkit_tables.rb"
  copy_file "passkit.rb", "config/initializers/passkit.rb"
end