Skip to content

Commit 481f2f5

Browse files
Use delete_prefix instead of sub
Co-authored-by: Copilot <[email protected]>
1 parent 8693902 commit 481f2f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/jsonapi/query_builder/mixins/sort/dynamic.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def matches?(sort_attribute)
1717
end
1818

1919
def results(collection, sort_param)
20-
dynamic_attribute = sort_param.attribute.sub(attribute_prefix, "")
20+
dynamic_attribute = sort_param.attribute.delete_prefix(attribute_prefix)
2121
if sort.respond_to?(:call)
2222
sort.call(collection, dynamic_attribute, sort_param.direction)
2323
else

0 commit comments

Comments
 (0)