This project is archived and is in readonly mode.
Changeset [ec5d846ac6137e60d81257041e4fde82c0480b32] by Piotr Sarnacki
Revision ec5d846ac6137e60d81257041e4fde82c0480b32,
committed by Piotr Sarnacki
· September 30th, 2010 @ 08:47 AM
Properly reload routes defined in class definition
Sometimes it's easier to define routes inside Engine or
Application class definition (e.g. one file applications). The
problem with such case is that if there is a plugin that
has config/routes.rb file, it will trigger routes reload on
application.
Since routes definition for application is not in
config/routes.rb
file routes_reloader will fail to reload application's routes
properly. With this commit you can pass routes definition as a
block
to routes method, which will allow to properly reload it:
class MyApp::Application < Rails::Application
routes do
resources :users
end end
http://github.com/rails/rails/commit/ec5d846ac6137e60d81257041e4fde...
4 changed files
-
M
actionpack/lib/action_dispatch/routing/route_set.rb -
M
railties/lib/rails/application.rb -
M
railties/lib/rails/engine.rb -
M
railties/test/railties/engine_test.rb