summaryrefslogtreecommitdiff
path: root/lib/generators/rails/post_deployment_migration/post_deployment_migration_generator.rb
blob: 392bd64019225eb224066c4246a0c2c4dadd7926 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
module Rails
  class PostDeploymentMigrationGenerator < Rails::Generators::NamedBase
    def create_migration_file
      timestamp = Time.now.strftime('%Y%m%d%H%I%S')

      template "migration.rb", "db/post_migrate/#{timestamp}_#{file_name}.rb"
    end

    def migration_class_name
      file_name.camelize
    end
  end
end