Sorting ActiveRecord results by enum values (in SQL)

Sponsored:

Every click leaves a trail. PureVPN shields your data from hackers, hides your location, and keeps your browsing private—especially on public Wi‑Fi.

In a world where your information is constantly exposed, a VPN puts control back in your hands.

Protect your privacy today—get PureVPN now.

Author:
Source

in_order_of is a new method in Rails 7 that allows you to sort by enum values directly in SQL

Read more