diff options
author | Chris Eppstein <chris@eppsteins.net> | 2011-06-18 12:10:09 -0700 |
---|---|---|
committer | Chris Eppstein <chris@eppsteins.net> | 2011-06-27 13:55:10 -0700 |
commit | 2cc1bc37732a5f89c8364e6724e8c39e14216a0a (patch) | |
tree | 5603640417c12b75b8baad66b8b5c5ed9af1d893 /actionpack/lib/action_view | |
parent | 6c64e1e3a33c2e703a9939f075fb57167b75b36a (diff) | |
download | rails-2cc1bc37732a5f89c8364e6724e8c39e14216a0a.tar.gz rails-2cc1bc37732a5f89c8364e6724e8c39e14216a0a.tar.bz2 rails-2cc1bc37732a5f89c8364e6724e8c39e14216a0a.zip |
Move the config bootstrapping to initialization to minimize access to the Rails.application global.
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/asset_paths.rb | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/actionpack/lib/action_view/asset_paths.rb b/actionpack/lib/action_view/asset_paths.rb index a74d45db6f..a768a0b882 100644 --- a/actionpack/lib/action_view/asset_paths.rb +++ b/actionpack/lib/action_view/asset_paths.rb @@ -107,20 +107,17 @@ module ActionView end def relative_url_root - if controller.respond_to?(:config) && controller.config - controller.config.relative_url_root - elsif config.respond_to?(:action_controller) && config.action_controller - config.action_controller.relative_url_root - elsif Rails.respond_to?(:application) && Rails.application.config - Rails.application.config.action_controller.relative_url_root - end + config = controller.config if controller.respond_to?(:config) + config ||= config.action_controller if config.action_controller.present? + config ||= config + config.relative_url_root end def asset_host_config - if config.respond_to?(:asset_host) + if config.action_controller.present? + config.action_controller.asset_host + else config.asset_host - elsif Rails.respond_to?(:application) - Rails.application.config.action_controller.asset_host end end |