闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
391 B

  1. # frozen_string_literal: true
  2. require 'rails/generators'
  3. module Rails
  4. class PostDeploymentMigrationGenerator < Rails::Generators::NamedBase
  5. def create_migration_file
  6. timestamp = Time.zone.now.strftime('%Y%m%d%H%M%S')
  7. template 'migration.rb', "db/post_migrate/#{timestamp}_#{file_name}.rb"
  8. end
  9. def migration_class_name
  10. file_name.camelize
  11. end
  12. end
  13. end