Class: ActsAsTracked::MigrationGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- ActsAsTracked::MigrationGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/acts_as_tracked/migration/migration_generator.rb
Constant Summary collapse
- MIGRATION_TIMESTAMP_FORMAT =
'%Y%m%d%H%M%S'
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(_path) ⇒ Object
14 15 16 |
# File 'lib/generators/acts_as_tracked/migration/migration_generator.rb', line 14 def self.next_migration_number(_path) Time.now.utc.strftime(MIGRATION_TIMESTAMP_FORMAT) end |
.source_root ⇒ Object
10 11 12 |
# File 'lib/generators/acts_as_tracked/migration/migration_generator.rb', line 10 def self.source_root File.join(File.dirname(__FILE__), 'templates', 'active_record') end |
Instance Method Details
#create_migration_file ⇒ Object
18 19 20 21 22 |
# File 'lib/generators/acts_as_tracked/migration/migration_generator.rb', line 18 def create_migration_file migration_template 'migration.erb', 'db/migrate/acts_as_tracked_migration.rb' { migration_version: migration_version } end |