Class: MakeVoteableGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(path) ⇒ Object



13
14
15
# File 'lib/generators/make_voteable/make_voteable_generator.rb', line 13

def self.next_migration_number(path)
  ActiveRecord::Generators::Base.next_migration_number(path)
end

.source_rootObject



9
10
11
# File 'lib/generators/make_voteable/make_voteable_generator.rb', line 9

def self.source_root
  @source_root ||= File.dirname(__FILE__) + '/templates'
end

Instance Method Details

#generate_migrationObject



17
18
19
# File 'lib/generators/make_voteable/make_voteable_generator.rb', line 17

def generate_migration
  migration_template 'migration.rb', 'db/migrate/create_make_voteable_tables'
end