Class: Auditrail::Generators::MigrationsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/migrations.rb

Instance Method Summary collapse

Instance Method Details

#prepareObject



9
10
11
12
13
# File 'lib/generators/migrations.rb', line 9

def prepare
  migrations_dir = File.join("db", "migrate")
  file_name = ::ActiveRecord::Generators::Base.next_migration_number(migrations_dir)
  copy_file("audits_table.rb", File.join(migrations_dir, "#{file_name.to_s}_create_audits.rb"))
end