Class: Ballot::Generators::InstallGenerator

Inherits:
Rails::Generators::Base show all
Extended by:
Ballot::Generators
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/ballot/install/install_generator.rb

Overview

The Rails generator to install the ballot_votes table.

Instance Attribute Summary

Attributes included from Ballot::Generators

#orm

Attributes inherited from Rails::Generators::Base

#argv, #destination

Instance Method Summary collapse

Methods included from Ballot::Generators

next_migration_number, orm_has_migration?, source_root

Methods inherited from Rails::Generators::Base

desc, generator_name, #migration_template

Instance Method Details

#create_migration_fileObject

:nodoc:



18
19
20
21
22
23
24
# File 'lib/generators/ballot/install/install_generator.rb', line 18

def create_migration_file #:nodoc:
  if self.class.orm_has_migration?
    migration_template 'migration.rb', 'db/migrate/install_ballot_vote_migration.rb'
  else
    warn "Unsupported ORM #{self.class.orm}"
  end
end