Class: AuditWeasel::Generators::AuditWeaselGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Extended by:
ActiveRecord::Generators::Migration
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/audit_weasel/audit_weasel_generator.rb

Overview

Creates a migration script to add the auditing columns to the given table

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(path) ⇒ Object



16
17
18
# File 'lib/generators/audit_weasel/audit_weasel_generator.rb', line 16

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

Instance Method Details

#create_audit_weasel_migrationObject



20
21
22
# File 'lib/generators/audit_weasel/audit_weasel_generator.rb', line 20

def create_audit_weasel_migration
  migration_template 'migration.rb', "db/migrate/audit_weasel_#{plural_name}.rb"
end