aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/sprockets/helpers/rails_helper.rb7
-rw-r--r--actionpack/lib/sprockets/railtie.rb2
2 files changed, 3 insertions, 6 deletions
diff --git a/actionpack/lib/sprockets/helpers/rails_helper.rb b/actionpack/lib/sprockets/helpers/rails_helper.rb
index 7d709de9e2..a95e7c0649 100644
--- a/actionpack/lib/sprockets/helpers/rails_helper.rb
+++ b/actionpack/lib/sprockets/helpers/rails_helper.rb
@@ -9,13 +9,8 @@ module Sprockets
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
diff --git a/actionpack/lib/sprockets/railtie.rb b/actionpack/lib/sprockets/railtie.rb
index 2020f8f095..c28bdc3061 100644
--- a/actionpack/lib/sprockets/railtie.rb
+++ b/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