Class: Pgbus::Generators::AddRecurringGenerator

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

Instance Method Summary collapse

Instance Method Details

#create_migration_fileObject



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

def create_migration_file
  migration_template "add_recurring_tables.rb.erb",
                     File.join(pgbus_migrate_path, "add_pgbus_recurring_tables.rb")
end

#create_recurring_configObject



27
28
29
# File 'lib/generators/pgbus/add_recurring_generator.rb', line 27

def create_recurring_config
  template "recurring.yml.erb", "config/recurring.yml"
end

#display_post_installObject



31
32
33
34
35
36
37
38
39
40
# File 'lib/generators/pgbus/add_recurring_generator.rb', line 31

def display_post_install
  say ""
  say "Pgbus recurring jobs installed!", :green
  say ""
  say "Next steps:"
  say "  1. Run: rails db:migrate#{":#{options[:database]}" if separate_database?}"
  say "  2. Edit config/recurring.yml to define your recurring tasks"
  say "  3. Restart pgbus: bin/pgbus start"
  say ""
end