brainspec/enumerize — pull request #147 by dtaniwaki (2014-03-22 04:02:58+00:00)
Title: Check attribute existence.

Please take a look of the following code.

```rb
class User < ActiveRecord::Base
# This model has only "role_with_column" column.
enumerize :role_with_column, in: [:normal, :admin]
enumerize :role_without_column, in: [:normal, :admin]
end
```

This code show a warning below because role_without_column column does not exist.
__DEPRECATION WARNING: You're trying to create an attribute \`offer_type_for_client'. Writing arbitrary attributes on a model is deprecated. Please just use `attr_writer` etc.__

A workaround is below.
```rb
class User < ActiveRecord::Base
# This model has only "role_with_column" column.
enumerize :role_with_column, in: [:normal, :admin]
attr_accessor :role_without_column
enumerize :role_without_column, in: [:normal, :admin]
end
```

However, I think this workaround is kind of redundant since `attr_accessor` is not necessary if the class is not an ActiveRecord::Base. Could you consider to merge this change?