I am trying to figure out what is the best way to store an enum value in activerecord but convert it to a \'title\' for display in an app.
I.E.
Review Enum:
there are a lot of posts about this issue, i guess that this points to most of them: http://thinkinginrails.com/2010/04/using-enums-for-constants/
i think that this is an over engineered thing, that you don't need in a dynamically typed language like ruby.
just use strings!
you could then use that like:
class Review < ActiveRecord::Base
validates_inclusion_of :status, :in => ["UNREVIEWED", "REVIEWED", "FLAGGED"]
def status
read_attribute(:status)
end
def status= (value)
write_attribute(:status, value)
end
end