Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use native String#end_with?, not the ActiveSupport wrapper #1905

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ nav_order: 5

## main

* Replace usage of `String#ends_with?` with `String#end_with?` to reduce the dependency on ActiveSupport core extensions.

*halo*

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I don't think this PR warrants an entry in the CHANGELOG, but it looked like one of the bot checks demanded it)

* Don't add ActionDispatch::Static middleware unless `public_file_server.enabled`.

*Daniel Gonzalez*
Expand Down
2 changes: 1 addition & 1 deletion lib/view_component/slotable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def raise_if_slot_registered(slot_name)
end

def raise_if_slot_ends_with_question_mark(slot_name)
raise SlotPredicateNameError.new(name, slot_name) if slot_name.to_s.ends_with?("?")
raise SlotPredicateNameError.new(name, slot_name) if slot_name.to_s.end_with?("?")
end

def raise_if_slot_conflicts_with_call(slot_name)
Expand Down
Loading