Skip to content

Commit df46170

Browse files
committed
Only use caller_locations in Rails 5
1 parent 3a4fe65 commit df46170

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/sprockets/rails/helper.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def compute_asset_path(path, options = {})
8888
message << "To bypass the asset pipeline and preserve this behavior,\n"
8989
message << "use the `skip_pipeline: true` option.\n"
9090

91-
call_stack = Kernel.respond_to?(:caller_locations) ? caller_locations : caller
91+
call_stack = Kernel.respond_to?(:caller_locations) && ::Rails::VERSION::MAJOR >= 5 ? caller_locations : caller
9292
ActiveSupport::Deprecation.warn(message, call_stack)
9393
end
9494
super

0 commit comments

Comments
 (0)