diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2010-09-26 00:17:06 +0200 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2010-09-30 09:47:05 +0200 |
commit | ec5d846ac6137e60d81257041e4fde82c0480b32 (patch) | |
tree | 4a0fb0b3eb176c908c68b8f01e3b3697a6522133 /actionpack/lib | |
parent | 22b11a41cc764bc0f7b0c0f518a5289230428597 (diff) | |
download | rails-ec5d846ac6137e60d81257041e4fde82c0480b32.tar.gz rails-ec5d846ac6137e60d81257041e4fde82c0480b32.tar.bz2 rails-ec5d846ac6137e60d81257041e4fde82c0480b32.zip |
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
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route_set.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 99a3019f3a..32f41934f1 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -1,6 +1,7 @@ require 'rack/mount' require 'forwardable' require 'active_support/core_ext/object/to_query' +require 'active_support/core_ext/hash/slice' module ActionDispatch module Routing |