Sha256: 62979b91f838a9dc6395fd9f9244924d1fea5858d21f31f5f1816fc7d5940adf

Contents?: true

Size: 817 Bytes

Versions: 1

Compression:

Stored size: 817 Bytes

Contents

# frozen_string_literal: true

require "rails/generators/active_record"

module AcidicJob
  module Generators
    class InstallGenerator < ::Rails::Generators::Base
      include ActiveRecord::Generators::Migration
      source_root File.expand_path("templates", __dir__)
      
      desc "Generates a migration for the AcidicJob::Run table."
    
      # Copies the migration template to db/migrate.
      def copy_acidic_job_runs_migration_files
        migration_template "create_acidic_job_runs_migration.rb.erb",
                           "db/migrate/create_acidic_job_runs.rb",
                           migration_version: migration_version
      end
    
      protected
    
      def migration_version
        "[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
acidic_job-1.0.0.pre4 lib/generators/acidic_job/install_generator.rb