Class: Recorder::InstallGenerator

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

Overview

Installs Recorder in a rails app.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(dirname) ⇒ Object



41
42
43
# File 'lib/generators/recorder/install_generator.rb', line 41

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

Instance Method Details

#create_migration_fileObject



34
35
36
37
38
39
# File 'lib/generators/recorder/install_generator.rb', line 34

def create_migration_file
  self.add_or_skip_recorder_migration('create_recorder_revisions')
  self.add_or_skip_recorder_migration('add_number_column_to_recorder_revisions') if options.with_number_column?
  self.add_or_skip_recorder_migration('add_index_by_user_id_to_recorder_revisions') if options.with_index_by_user_id?
  self.add_or_skip_recorder_migration('add_partitions_to_recorder_revisions') if options.with_partitions?
end