Sha256: 44ce6e8447b5cd6f391cc26ea420d77e1e62a38134f22187fc927cd1a30660c1

Contents?: true

Size: 726 Bytes

Versions: 3

Compression:

Stored size: 726 Bytes

Contents

require "generators/delayed_job/delayed_job_generator"
require "generators/delayed_job/next_migration_version"
require "rails/generators/migration"
require "rails/generators/active_record"

# Extend the DelayedJobGenerator so that it creates an AR migration
module DelayedJob
  class UpgradeGenerator < ::DelayedJobGenerator
    include Rails::Generators::Migration
    extend NextMigrationVersion

    source_paths << File.join(File.dirname(__FILE__), "templates")

    def create_migration_file
      migration_template "upgrade_migration.rb", "db/migrate/add_queue_to_delayed_jobs.rb"
    end

    def self.next_migration_number(dirname)
      ActiveRecord::Generators::Base.next_migration_number dirname
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
delayed_job_active_record-4.1.1 lib/generators/delayed_job/upgrade_generator.rb
delayed_job_active_record-4.1.0 lib/generators/delayed_job/upgrade_generator.rb
delayed_job_active_record-4.0.3 lib/generators/delayed_job/upgrade_generator.rb