Class: PaperTrail::InstallGenerator
- Inherits:
-
MigrationGenerator
- Object
- Rails::Generators::Base
- MigrationGenerator
- PaperTrail::InstallGenerator
- 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
Instance Method Details
#create_migration_file ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/generators/paper_trail/install/install_generator.rb', line 34 def create_migration_file # Use the table_name to create the proper migration filename add_paper_trail_migration( "create_#{table_name}", item_type_options: , versions_table_options: , item_id_type_options: , version_table_primary_key_type: version_table_primary_key_type ) if .with_changes? add_paper_trail_migration("add_object_changes_to_#{table_name}") end end |