scally/legacy_enum — pull request #10 by jbgo (2014-01-10 20:30:16+00:00)
Title: Set enum values with strings or symbols

When setting a legacy enum value, I want to be able to use strings and not just symbols to set the value.

For example, let's say I have the following legacy enum on my model:

```
legacy_enum :payroll_type do |e|
e.salaried 1
e.full_time 2
e.part_time 3
end
```

Then I would expect `model.payroll_type = 'salaried'` to work just like `model.payroll_type = :salaried`. Both should result in `model.PayrollTypeID => 1`. Currently only the latter expression works.

This is especially helpful in cases where the legacy enum is set from user input, like that coming from a select field in an HTML form.