Login
Roast topics
Find topics
Find it!
From:
Boring Rails: Skip the bullshit and ship fast |
(Uncensored)
subscribe
Sorting ActiveRecord results by enum values (in SQL)
https://boringrails.com/tips/rails-active-record-sort-by-enum
links
backlinks
Tagged with:
product
ruby
rails
Roast topics
Find topics
Roast it!
Rails enums are a great way to model things like a status on an ActiveRecord model. They provide a set of human-readable methods while storing the result as an integer in the database.