Class: Pgbus::Generators::AddBatchCallbackJobsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
ActiveRecord::Generators::Migration, MigrationPath
Defined in:
lib/generators/pgbus/add_batch_callback_jobs_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_migration_fileObject



22
23
24
25
# File 'lib/generators/pgbus/add_batch_callback_jobs_generator.rb', line 22

def create_migration_file
  migration_template "add_batch_callback_jobs.rb.erb",
                     File.join(pgbus_migrate_path, "add_pgbus_batch_callback_jobs.rb")
end

#display_post_installObject



27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/generators/pgbus/add_batch_callback_jobs_generator.rb', line 27

def display_post_install
  say ""
  say "Pgbus configured batch callbacks installed!", :green
  say ""
  say "Next steps:"
  say "  1. Run: rails db:migrate#{migrate_command_suffix}"
  say "  2. Restart pgbus: bin/pgbus start"
  say ""
  say "You can now pass a configured ActiveJob instance to a batch:"
  say "  Pgbus::Batch.new(on_finish: ReportJob.new.set(queue: :critical, wait: 5.minutes))"
  say ""
end