RailsCasts Pro episodes are now free!

Learn more or hide this

ray neville's Profile

GitHub User: rayzor

Site: grainmaster.net

Comments by ray neville


One very good explanation why my approach does not work.


load "#{Rails.root}/jobs/#{prawn_script_name}.rb" DOES WORK.


I need to pass arguments e.g account_id to the Prawn scripts to scope the data for the pdfs.

runner allows ARG[]s to be passed but "load" does not!

Delayed_job has the arguments in its table but how do I make these accessible to the Prawn scripts?

This is my next hurdle to overcome.


Changed from Bj(no longer supported in Rail3) to Delayed_job but seems not to handle rails runner.

class ReportJob < Struct.new(:prawn_script_name , :account_id )
def perform
bundle exec rails runner "#{Rails.root}/jobs/#{prawn_script_name}.rb #{account_id}"

Error in last_error field.
{undefined method `runner' for #ReportJob:0xc28f080

OUCH! .... will try Resque.