raphaelr/nice_enum — pull request #1 by timscott (2013-05-15 22:20:54+00:00)
Title: Add Some ActiveRecord Support

I love nice_enum but it's a bit painful to use it for ActiveRecord model attributes. When accessing the attributes you must either convert back and forth from the string representation on every access or override the getters and setters one by one. With is change you can do the following.

On app initialization:

```ruby
ActiveRecord::Base.send :include, NiceEnumActiveRecordExtension
```

Then in you model:

```ruby
map_enum :status, OrderStatus
```

Then on instances of the model you can access the attribute as the enum type:

```ruby
order.status = OrderStatus::Shipped
puts order.status.description
```