The employer needs to explicitly establish a connection to the database, since it does not work in your application, so you need to transfer the connection information to your employee. You can do this in a workload as follows:
client = IronWorkerNG::Client.new
task = client.tasks.create('MyWorker', 'database' => Rails.configuration.database_configuration[Rails.env])
Then inside your worker:
ActiveRecord::Base.establish_connection(params['database'])
source
share