Sha256: cf7a22eaf945836d43dae3500efc8e08e9aa685e2b10f92ca52584ee5ed5dd6e
Contents?: true
Size: 1000 Bytes
Versions: 23
Compression:
Stored size: 1000 Bytes
Contents
require 'rails/generators' require 'rails/generators/active_record' module GoodJob # # Implements the Rails generator used for setting up GoodJob in a Rails # application. Run it with +bin/rails g good_job:install+ in your console. # # This generator is primarily dedicated to stubbing out a migration that adds # a table to hold GoodJob's queued jobs in your database. # class InstallGenerator < Rails::Generators::Base include Rails::Generators::Migration class << self delegate :next_migration_number, to: ActiveRecord::Generators::Base end source_paths << File.join(File.dirname(__FILE__), "templates") # Generates the actual migration file and places it on disk. def create_migration_file migration_template 'migration.rb.erb', 'db/migrate/create_good_jobs.rb', migration_version: migration_version end private def migration_version "[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]" end end end
Version data entries
23 entries across 23 versions & 1 rubygems