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

[7.3-stable] fix attribute sorting across Ruby versions #3163

Merged
merged 2 commits into from
Jan 24, 2025

Conversation

alchemycms-bot
Copy link
Collaborator

Backport

This will backport the following commits from main to 7.3-stable:

Questions ?

Please refer to the Backport tool documentation

Chaining sort_by methods caused issues because each subsequent sort_by effectively overrides the previous sort order by re-sorting the entire array based solely on the new condition. This can disrupt the prioritization of earlier sorting criteria.

Interestingly, chaining multiple sort_by calls has been working as expected in Ruby versions prior to 3.3.1, as the underlying behavior of Array#sort_by appears to have been consistent in preserving the prioritization of earlier steps.

Switching to a single sort_by call ensures the logic remains robust and compatible across Ruby versions, including 3.3.1.

Fixes #3152

(cherry picked from commit 5d397f5)
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.47%. Comparing base (9c829b2) to head (b1d1fa1).
Report is 3 commits behind head on 7.3-stable.

Additional details and impacted files
@@             Coverage Diff             @@
##           7.3-stable    #3163   +/-   ##
===========================================
  Coverage       96.47%   96.47%           
===========================================
  Files             237      237           
  Lines            6419     6419           
===========================================
  Hits             6193     6193           
  Misses            226      226           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@robinboening robinboening merged commit 717fc6e into 7.3-stable Jan 24, 2025
42 checks passed
@robinboening robinboening deleted the backport/7.3-stable/pr-3153 branch January 24, 2025 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants