Class: Ballot::Generators::SummaryGenerator

Inherits:
Rails::Generators::NamedBase show all
Extended by:
Ballot::Generators
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/ballot/summary/summary_generator.rb

Overview

The Rails generator to install the cache_ballot_summary column on the indicated 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::NamedBase

#class_name, #file_name, #initialize, #plural_table_name

Methods inherited from Rails::Generators::Base

desc, generator_name, #migration_template

Constructor Details

This class inherits a constructor from Rails::Generators::NamedBase

Instance Method Details

#create_migration_fileObject

:nodoc:



19
20
21
22
23
24
# File 'lib/generators/ballot/summary/summary_generator.rb', line 19

def create_migration_file #:nodoc:
  if self.class.orm_has_migration?
    migration_template 'migration.rb',
      "db/migrate/ballot_cache_for_#{file_name}.rb"
  end
end