Skip to content

Commit

Permalink
Use native String#end_with?, not the Rails wrapper (#1905)
Browse files Browse the repository at this point in the history
  • Loading branch information
halo authored Nov 8, 2023
1 parent 00cdde8 commit 0820ce8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
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*

* 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

0 comments on commit 0820ce8

Please sign in to comment.