Class: PaperTrailAssociationTracking::AddForeignTypeToVersionAssociationsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/paper_trail_association_tracking/add_foreign_type_to_version_associations_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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(dirname) ⇒ Object


27
28
29
# File 'lib/generators/paper_trail_association_tracking/add_foreign_type_to_version_associations_generator.rb', line 27

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

Instance Method Details

#create_migrationsObject


23
24
25
# File 'lib/generators/paper_trail_association_tracking/add_foreign_type_to_version_associations_generator.rb', line 23

def create_migrations
  add_paper_trail_migration("add_foreign_type_to_version_associations")
end