lwe/simple_enum — pull request #41 by Tigraine (2013-04-09 15:17:58+00:00)
Title: Removed read_attributes and write_attributes in favor of send

The model of `respond_to?(:read_attribute)` does not work with ActiveRecord classes that define their `enum_cd` as a `attr_accessor`.

I have such a case where I want the enum to be there for view-validation and i18n, but I serialize the results manually to the database. Due to `read_attribute` being present simple_enum is trying to call `read_attribute` on a field that's not managed by ActiveRecord.

``` ruby
class Command < ActiveRecord::Base
attr_accessor :result_cd
as_enum :result, [:a, :b, :c]
end
```

After looking through the code I noticed that there is already a switch for Mongoid that uses send instead of read_attribute and all tests still pass with AR 3.2

Is there some reason read_attribute and write_attribute is still used instead of the setters/getters?