Displaying 2 results from an estimated 2 matches for "acts_as_enum".
2006 Mar 23
8
DRY principle - how to implement?
Hi all!
I have ''send_status'' table which looks something like these:
id code title
1 sent Sent
2 error Sending error
3 success Success
Next I would like to associate some processed records with their
''send_status''. Is it better to use:
1)
record.status_id = SendStatus.find(:one, :condition => "code=''sent''").id
to
2005 Aug 19
13
Enumerations (again): Comments please
Some of my earlier questions may have hinted ever so slightly in the
direction that I''m trying to implement "enumerations". By an
enumeration here I mean a class that has a fixed number of immutable
instances, which in turn have essentially only a name and a position.
Requirements I''ve tried to meet are
- Enumeration instances should only be loaded once from the