GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Fork of rails/rails
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/NZKoz/rails.git
Can't use controller_path due to Admin model and Admin::UserController 
case

git-svn-id: http://svn-commit.rubyonrails.org/rails/branches/stable@4750 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Nicholas Seckar (author)
Thu Aug 10 10:13:55 -0700 2006
commit  e071b60e17913e210baf9bf77c4c5c0bb344d999
tree    89875d30d4002b90b07dfc0aeb4c1f570e256dd6
parent  720f990472f206788227ee8d3fc7d9c91a4cfd6e
...
262
263
264
265
266
267
 
 
 
 
 
 
 
 
 
 
 
 
268
269
270
271
 
272
273
274
...
262
263
264
 
 
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
 
281
282
283
284
0
@@ -262,13 +262,23 @@ module ActionController
0
           nil
0
         end
0
         
0
- attr_accessor :controller_paths
0
-
0
       protected
0
+ def safe_load_paths #:nodoc:
0
+ if defined?(RAILS_ROOT)
0
+ $LOAD_PATH.select do |base|
0
+ base = File.expand_path(base)
0
+ extended_root = File.expand_path(RAILS_ROOT)
0
+ # Exclude all paths that are not nested within app, lib, or components.
0
+ base.match(/\A#{Regexp.escape(extended_root)}\/*(app|lib|components)\/[a-z]/) || base =~ %r{rails-[\d.]+/builtin}
0
+ end
0
+ else
0
+ $LOAD_PATH
0
+ end
0
+ end
0
         
0
         def attempt_load(mod, const_name, path)
0
           has_dir = false
0
- controller_paths.each do |load_path|
0
+ safe_load_paths.each do |load_path|
0
             full_path = File.join(load_path, path)
0
             file_path = full_path + '.rb'
0
             if File.file?(file_path) # Found a .rb file? Load it up
...
236
237
238
239
240
241
242
...
236
237
238
 
239
240
241
0
@@ -236,7 +236,6 @@ module Rails
0
     # loading module used to lazily load controllers (Configuration#controller_paths).
0
     def initialize_routing
0
       return unless configuration.frameworks.include?(:action_controller)
0
- ActionController::Routing::ControllerComponent.controller_paths = configuration.controller_paths
0
       ActionController::Routing::Routes.reload
0
     end
0
     

Comments

    No one has commented yet.