On May 4, 2008, at 4:09 PM, Scott Willson wrote:

I override some Rails' configuration options in my project, like:
config.database_configuration_file = "#{RAILS_ROOT}/local/config/ database.yml"

But they aren't picked up in BackgroundRB because Rails ActiveRecord is just initialized directly in MasterWorker#load_rails_env: db_config_file = YAML.load(ERB.new(IO.read("#{RAILS_HOME}/ config/database.yml")).result)

Hey folks,

So this looks easy enough. You just need to change MetaWorker#load_rails_env to load the entire Rails environment rather than just read the database config + ActiveRecord. Patch attached (I apologize for not doing a nifty Git fork/patch).

I'm a bit leery of side effects from this patch—your mileage may vary— but it does fix my issue and seems to work just fine in my app.

Scott

Attachment: meta_worker_rails_env.diff
Description: Binary data


_______________________________________________
Backgroundrb-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/backgroundrb-devel

Reply via email to