Class: PaperTrail::InstallGenerator

Inherits:
MigrationGenerator show all
Defined in:
lib/generators/paper_trail/install/install_generator.rb

Overview

Installs PaperTrail in a rails app.

Constant Summary collapse

MYSQL_ADAPTERS =

Class names of MySQL adapters.

  • ‘MysqlAdapter` - Used by gems: `mysql`, `activerecord-jdbcmysql-adapter`.

  • ‘Mysql2Adapter` - Used by `mysql2` gem.

[
  "ActiveRecord::ConnectionAdapters::MysqlAdapter",
  "ActiveRecord::ConnectionAdapters::Mysql2Adapter"
].freeze

Instance Method Summary collapse

Methods inherited from MigrationGenerator

next_migration_number

Instance Method Details

#create_migration_fileObject



27
28
29
30
31
32
# File 'lib/generators/paper_trail/install/install_generator.rb', line 27

def create_migration_file
  add_paper_trail_migration("create_versions",
    item_type_options: item_type_options,
    versions_table_options: versions_table_options)
  add_paper_trail_migration("add_object_changes_to_versions") if options.with_changes?
end