Skip to content

Commit

Permalink
Stop the initializer from blowing up when builtin_directories is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl Lerche committed Jun 30, 2009
1 parent 4954379 commit f66b5d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion railties/lib/rails/configuration.rb
Expand Up @@ -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!
Expand Down

3 comments on commit f66b5d7

@alloy
Copy link
Contributor

@alloy alloy commented on f66b5d7 Jun 30, 2009

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@carllerche
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

@alloy alloy commented on f66b5d7 Jul 1, 2009

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah gotcha, should have looked that up :)

Please sign in to comment.