Skip to content

Commit

Permalink
Remove conditional for caller_locations
Browse files Browse the repository at this point in the history
Kernel#caller_locations was added in ruby 2, and the required ruby
version is 2.5

The Rails version check will also always be true since the minimum Rails
version is 5.2
  • Loading branch information
skipkayhil committed Jul 13, 2022
1 parent 51bf36a commit 83d858f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/sprockets/rails/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,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) && ::Rails::VERSION::MAJOR >= 5 ? caller_locations : caller
ActiveSupport::Deprecation.warn(message, call_stack)
ActiveSupport::Deprecation.warn(message, caller_locations)
end
super
end
Expand Down

0 comments on commit 83d858f

Please sign in to comment.