search for: vrtual

Displaying 1 result from an estimated 1 matches for "vrtual".

Did you mean: virtual
2007 Aug 23
4
Idiomatic way to do a non-database Enumeration?
I have a class which stores as one of its attributes a day of the week as an integer (0-6, 0=Sunday, standard UNIXy values). I want, obviously, the views to show the weekday name and the forms to provide a drop-down with the weekday names. Essentially it''s a vrtual attribute whose value is the localized weekday name, which maps to the integer value that''s actually stored. There are a lot of approaches, but I was wondering what the idiomatic Rails-y way of doing it is. Should I create a Weekday class? It wouldn''t be backed by the db - that...