views:

13

answers:

1

In Rails 2 I know of a few plugins for enumerations such as acts_as_enumeration and enumerate_by but they don't seem to be maintained or updated for Rails 3. Preferably, the solution would store the enum in memory rather than a database for performance reasons but really any method would be useful since it can always be cached.

I did find enumerated_attribute that claims to work with Rails 3 but quite honestly I don't like the API and was hoping for another good solution.

(Sorry for only linking to the one plugin but it won't let me post more than one link until I get a higher reputation)

A: 

If you're using DataMapper as your ORM have a look at dm-types which includes an Enum type.

Matt von Rohr