Class: Tldr::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Tldr::Generators::InstallGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/tldr/install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(dirname) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/generators/tldr/install_generator.rb', line 14 def self.next_migration_number(dirname) if ActiveRecord::Base. sleep 1 # make sure each time we get a different timestamp Time.new.utc.strftime("%Y%m%d%H%M%S") else "%.3d" % (current_migration_number(dirname) + 1) end end |
Instance Method Details
#copy_migrations ⇒ Object
10 11 12 |
# File 'lib/generators/tldr/install_generator.rb', line 10 def copy_migrations migration_template "migration/create_cancelled_subscriptions_table.rb", "db/migrate/create_cancelled_subscriptions_table.rb" end |