Photo by Veron Wessels on Unsplash

TLDR: Enums are a great user-defined model level validation for stored values. There are many ways to implement enums in Ruby on Rails, but the best way uses hashes with strings for the keys and values.

Ruby on Rails is great for newer developers as it preaches convention over configuration. What this means is that there is a community agreed upon “correct” way to setup models and controllers. This convention includes scaffolding scripts which makes setup quicker, allowing for more time implementing solutions rather than writing boilerplate code.

When creating database migrations there are a number of different types for…

Daniel Pericich

Former Big Beer Engineer turned Full Stack Software Engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store