[Backgroundrb-devel] :load_rails

Michael Siebert info at siebert-wd.de
Mon Aug 7 11:41:49 EDT 2006


if CONFIG['load_rails']
  ActiveRecord::Base.allow_concurrency = true
  ActiveRecord::Base.establish_connection(YAML.load(ERB.new(IO.read
("#{RAILS_ROOT}/#{CONFIG['database_yml']}")).result)[CONFIG['environment']])
end

if i read the code right, this option doesnt really load rails. wouldnt it
be better (for those who rely on the config vars set in environment.rb) to
  require(File.join(RAILS_ROOT, 'config', 'environment'))
so the rails core is started up and even the ActionMailer setup is loaded
DRY. and the better, sql logs go to (devel|test|production).log

what does everone think about it? are there any side-effects i dont know
about?

-- 
Michael Siebert <info at siebert-wd.de>

www.stellar-legends.de - Weltraum-Browsergame im Alpha-Stadium
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060807/974f2697/attachment.html 


More information about the Backgroundrb-devel mailing list