Class: ActiveModelLogger::Generators::InstallGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(dirname) ⇒ Object



9
10
11
12
# File 'lib/active_model_logger/generators/active_model_logger/install_generator.rb', line 9

def self.next_migration_number(dirname)
  next_migration_number = current_migration_number(dirname) + 1
  ActiveRecord::Migration.next_migration_number(next_migration_number)
end

Instance Method Details

#create_migrationObject



14
15
16
17
# File 'lib/active_model_logger/generators/active_model_logger/install_generator.rb', line 14

def create_migration
  migration_file = "db/migrate/#{migration_file_name}.rb"
  template "create_active_model_logs.rb", migration_file
end