Class: ConfigScripts::MigrationsGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- ConfigScripts::MigrationsGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/config_scripts/generators/migrations.rb
Overview
This class provides a generator for creating the migrations that we need to use this gem.
Class Method Summary collapse
-
.next_migration_number(dirname) ⇒ Object
This method gets the number for the next migration created by this generator.
Instance Method Summary collapse
-
#create_migrations ⇒ Object
This generator creates the migrations that we need for the gem.
Class Method Details
.next_migration_number(dirname) ⇒ Object
This method gets the number for the next migration created by this generator.
We use the current timestamp.
21 22 23 |
# File 'lib/config_scripts/generators/migrations.rb', line 21 def self.next_migration_number(dirname) Time.now.to_s(:number) end |
Instance Method Details
#create_migrations ⇒ Object
This generator creates the migrations that we need for the gem.
10 11 12 |
# File 'lib/config_scripts/generators/migrations.rb', line 10 def create_migrations copy_migration 'create_config_scripts' end |