Permalink
Browse files

Stop the initializer from blowing up when builtin_directories is empty

  • Loading branch information...
1 parent 4954379 commit f66b5d79c15c92e0712315b5843e611114390a12 Carl Lerche committed Jun 30, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 railties/lib/rails/configuration.rb
View
2 railties/lib/rails/configuration.rb
@@ -76,7 +76,7 @@ def set_root_path!
@paths.config.locales = "config/locales"
@paths.config.environments = "config/environments"
- @paths.app.controllers.push *builtin_directories
+ builtin_directories.each { |dir| @paths.app.controllers << dir }
@paths.app.load_path!
@paths.app.metals.load_path!

3 comments on commit f66b5d7

@alloy

Another way to do this, without the need to iterate, is to use Array#concat: @paths.app.controllers.concat(buitin_directories)

@carllerche

#concat isn't implemented on the Path class (of which @paths.app.controllers is an instance of), but it seems ok to add it.

@alloy

Ah gotcha, should have looked that up :)

Please sign in to comment.