This project is archived and is in readonly mode.

#5001 ✓invalid
James Harton

config.load_paths gone, but no deprecation warning.

Reported by James Harton | June 29th, 2010 @ 05:36 AM

Hi.

My app has the following in config/application.rb:

['posts', 'clusters', 'connections'].each do |dir|
  path = File.join(Rails.root, 'app', 'models', dir)
  config.load_paths << path
end

Which causes the following error:

[15:50][jnh@marvin]~/Dev/Kimono$ r s /Users/jnh/.rvm/gems/ruby-1.8.7-p249/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/railtie/configuration.rb:76:in method_missing': undefined methodload_paths' for #<Rails::Application::Configuration:0x33deda4> (NoMethodError)

from /Users/jnh/Dev/Kimono/config/application.rb:48
from /Users/jnh/Dev/Kimono/config/application.rb:46:in `each'
from /Users/jnh/Dev/Kimono/config/application.rb:46
from /Users/jnh/.rvm/gems/ruby-1.8.7-p249/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/commands.rb:28:in `require'
from /Users/jnh/.rvm/gems/ruby-1.8.7-p249/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/commands.rb:28
from /Users/jnh/.rvm/gems/ruby-1.8.7-p249/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/commands.rb:27:in `tap'
from /Users/jnh/.rvm/gems/ruby-1.8.7-p249/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/commands.rb:27
from script/rails:9:in `require'
from script/rails:9

Should this not create a deprecation warning and send the request to config.autoload_paths?

I think commit 9b19a6f16cebf4257d2f0b839f6cc8ff5db5c47b caused this.

Comments and changes to this ticket

  • José Valim

    José Valim June 29th, 2010 @ 09:13 AM

    • Importance changed from “” to “Low”

    Please provide a patch that adds the required deprecations here:

    http://github.com/rails/rails/blob/master/railties/lib/rails/config...

    Thanks!

  • Xavier Noria

    Xavier Noria June 29th, 2010 @ 10:21 AM

    Please if you do this patch say it will be removed in final. Rails 3 is gonna use autoload_paths.

    This is a change in a beta, RC will be frozen in this sense and won't have changes like this (unless something critical shows up, you know). So it is a warning just between beta and final.

  • James Harton

    James Harton June 29th, 2010 @ 10:07 PM

    You don't think that the deprecation warning should be present in every release up to the point where it is removed?

  • Xavier Noria

    Xavier Noria June 29th, 2010 @ 10:26 PM

    Yes, but there's no release of Rails 3 yet.

    The golden path for an application in Rails 2 is to first upgrade to the last 2.3, that is, the one released together with Rails 3. There you get rid of all warnings, and then you start with Rails 3 proper.

    In my view it is OK to break prereleases like that within some common sense, you know there's a lot going on occasionally some incompatibility is introduced for the benefit of final.

    That's why I didn't introduce a warning in master, if you are upgrading betas I prefer that the application clearly manifests you need to change that. Otherwise you may not notice until final, which is gonna be worse.

  • José Valim

    José Valim June 30th, 2010 @ 12:21 PM

    Could someone please provide a patch or this can be closed?

  • José Valim

    José Valim July 8th, 2010 @ 10:13 PM

    • State changed from “new” to “invalid”

    Ok, I'm closing this. If anyone feels like contributing a patch, I will reopen.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages