Class: EloRankable::Generators::InstallGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.default_generator_rootObject



20
21
22
# File 'lib/generators/elo_rankable/install/install_generator.rb', line 20

def self.default_generator_root
  File.dirname(__FILE__)
end

.next_migration_number(dirname) ⇒ Object



15
16
17
18
# File 'lib/generators/elo_rankable/install/install_generator.rb', line 15

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

#create_migration_fileObject



24
25
26
# File 'lib/generators/elo_rankable/install/install_generator.rb', line 24

def create_migration_file
  migration_template 'create_elo_rankings.rb', 'db/migrate/create_elo_rankings.rb'
end