RubyFlow The Ruby and Rails community linklog

Creating easy, readable attributes with ActiveRecord enums

Imagine a question that can be either “pending”, “approved”, or “flagged”. Some models call for this kind of data. An attribute that can have only one of a few different values, values that rarely change. Recently, Rails took a stab at solving this with ActiveRecord enums.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in