Class: Gemboree::Generators::MigrationGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Gemboree::Generators::MigrationGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/gemboree/migration_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(dirname) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/generators/gemboree/migration_generator.rb', line 9 def self.next_migration_number(dirname) if ActiveRecord::Base. migration_number = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i migration_number += 1 migration_number.to_s else "%.3d" % (current_migration_number(dirname) + 1) end end |
Instance Method Details
#create_migration ⇒ Object
19 20 21 |
# File 'lib/generators/gemboree/migration_generator.rb', line 19 def create_migration migration_template "migration.rb", "db/migrate/acts_as_actor" end |