From df46170c984f055743d658212f0656f2c51aab10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Thu, 31 Aug 2017 16:09:46 -0400 Subject: [PATCH] Only use caller_locations in Rails 5 --- lib/sprockets/rails/helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sprockets/rails/helper.rb b/lib/sprockets/rails/helper.rb index 03174c07..62491dfc 100644 --- a/lib/sprockets/rails/helper.rb +++ b/lib/sprockets/rails/helper.rb @@ -88,7 +88,7 @@ def compute_asset_path(path, options = {}) message << "To bypass the asset pipeline and preserve this behavior,\n" message << "use the `skip_pipeline: true` option.\n" - call_stack = Kernel.respond_to?(:caller_locations) ? caller_locations : caller + call_stack = Kernel.respond_to?(:caller_locations) && ::Rails::VERSION::MAJOR >= 5 ? caller_locations : caller ActiveSupport::Deprecation.warn(message, call_stack) end super