Class: RailsApiLogger::Generators::InstallGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(dirname) ⇒ Object

Implement the required interface for Rails::Generators::Migration.



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

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

#copy_migrationsObject



20
21
22
# File 'lib/generators/rails_api_logger/install_generator.rb', line 20

def copy_migrations
  migration_template "create_rails_api_logger_table.rb", "db/migrate/create_rails_api_logger_table.rb"
end