Class: SolidQueue::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/solid_queue/install/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_solid_queueObject



8
9
10
11
12
13
14
# File 'lib/generators/solid_queue/install/install_generator.rb', line 8

def add_solid_queue
  if (env_config = Pathname(destination_root).join("config/environments/production.rb")).exist?
    gsub_file env_config, /(# )?config\.active_job\.queue_adapter\s+=.*/, "config.active_job.queue_adapter = :solid_queue"
  end

  copy_file "config.yml", "config/solid_queue.yml"
end

#create_migrationsObject



16
17
18
19
20
# File 'lib/generators/solid_queue/install/install_generator.rb', line 16

def create_migrations
  unless options[:skip_migrations]
    rails_command "railties:install:migrations FROM=solid_queue", inline: true
  end
end