<p>In an Active Record model, usually you will have a column that can only have a
set of pre-defined values (such as a <code>status</code> column). Normally, you would
define a constant for those values as well as several helper methods like the
following example…</p>

Read more at the source