jeffp/enumerated_attribute — pull request #64 by alextk (2013-08-26 12:33:01+00:00)
Title: fix: use values returned by attribute setter methods

Hi Jeff,

I've discovered extremely annoying bug that is causing active record models to misbehave. If model defines setter methods that change values that are passed, the processed values are reverted back to original values (in new or build assoc methods) by your gem (all logic in setter method is discarded).
For example:

```ruby
class User
def email=(value)
value = value.strip
write_attribute(:email, value)
end
end

u = User.new(:email => ' asfd@asdf.com ')
u.email # will return ' asfd@asdf.com ', but should return 'asfd@asdf.com'
```

Please accept one line fix pull request, which also contains rspec.

Regards,
Alex