Permalink
Browse files

Move config.default_asset_host_protocol to the railtie.

  • Loading branch information...
1 parent 2a24bcc commit e01aba15043fabf937bd6dbb818b6bce9a90651a @josevalim josevalim committed Jul 7, 2011
Showing with 3 additions and 6 deletions.
  1. +1 −6 actionpack/lib/sprockets/helpers/rails_helper.rb
  2. +2 −0 actionpack/lib/sprockets/railtie.rb
View
7 actionpack/lib/sprockets/helpers/rails_helper.rb
@@ -9,13 +9,8 @@ module RailsHelper
def asset_paths
@asset_paths ||= begin
config = self.config if respond_to?(:config)
+ config ||= Rails.application.config
controller = self.controller if respond_to?(:controller)
- config ||= Rails.application.config
- if config.action_controller.present?
- config.action_controller.default_asset_host_protocol ||= :relative
- else
- config.default_asset_host_protocol ||= :relative
- end
paths = RailsHelper::AssetPaths.new(config, controller)
paths.asset_environment = asset_environment
paths.asset_prefix = asset_prefix
View
2 actionpack/lib/sprockets/railtie.rb
@@ -5,6 +5,8 @@ module Sprockets
# TODO: Get rid of config.assets.enabled
class Railtie < ::Rails::Railtie
+ config.default_asset_host_protocol = :relative
+
rake_tasks do
load "sprockets/assets.rake"
end

0 comments on commit e01aba1

Please sign in to comment.