Mastering database enums in Rails with Postgres - Guide ruby

Mastering database enums in Rails with Postgres - Guide

Database enums in PostgreSQL give Rails apps type safety, implicit ordering, and faster queries than string columns. Single-value enums with validation, multi-select enum arrays, dynamic enum management, and the migrations that wire it all together.

Dec 30, 2024

Solutions for const and enums per class in Ruby ruby

Solutions for const and enums per class in Ruby

Three ways to define constants and enums per class in Ruby: the ActiveRecord enum macro, a mixed style combining frozen constants with enum, and a dependency-free PORO version. Code for each solution and a comparison to help you pick the right one.

Mar 12, 2023