Sha256: bbf1397a1b90a88c58ee6093d66a0a8db0298b398ca99355c07d3ea25c9a9791

Contents?: true

Size: 800 Bytes

Versions: 44

Compression:

Stored size: 800 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

44 entries across 44 versions & 1 rubygems

Version Path
acidic_job-0.9.0 lib/generators/acidic_job/install_generator.rb
acidic_job-0.8.8 lib/generators/acidic_job/install_generator.rb
acidic_job-0.8.7 lib/generators/acidic_job/install_generator.rb
acidic_job-0.8.5 lib/generators/acidic_job/install_generator.rb
acidic_job-0.8.4 lib/generators/acidic_job/install_generator.rb
acidic_job-0.8.3 lib/generators/acidic_job/install_generator.rb
acidic_job-0.8.2 lib/generators/acidic_job/install_generator.rb
acidic_job-0.8.1 lib/generators/acidic_job/install_generator.rb
acidic_job-0.8.0 lib/generators/acidic_job/install_generator.rb
acidic_job-1.0.0.beta.10 lib/generators/acidic_job/install_generator.rb
acidic_job-1.0.0.beta.9 lib/generators/acidic_job/install_generator.rb
acidic_job-1.0.0.beta.8 lib/generators/acidic_job/install_generator.rb
acidic_job-1.0.0.beta.7 lib/generators/acidic_job/install_generator.rb
acidic_job-1.0.0.beta.6 lib/generators/acidic_job/install_generator.rb
acidic_job-1.0.0.beta.5 lib/generators/acidic_job/install_generator.rb
acidic_job-1.0.0.beta.4 lib/generators/acidic_job/install_generator.rb
acidic_job-1.0.0.beta.3 lib/generators/acidic_job/install_generator.rb
acidic_job-1.0.0.beta.2 lib/generators/acidic_job/install_generator.rb
acidic_job-1.0.0.beta.1 lib/generators/acidic_job/install_generator.rb
acidic_job-1.0.0.pre29 lib/generators/acidic_job/install_generator.rb