rails/rails — pull request #14346 by jaxi (2014-03-11 01:22:46+00:00)
Title: enum naming conflict solved by adding name of enum as prefix

```ruby
class Book < ActiveRecord::Base
enum status: [:dispatch, :delivering, :sent]
enum refund: {dispatch: 0, delivering: 2, sent: 3}
end
```

Considering this kind of situation, if calling ```@book.dispatch?```, Rails will only show whether book refunding is dispatched or not, since dispatch? method has been overwritten. This kind of naming conflict sometimes might cause misunderstanding.

My solution is simply adding enum name as the prefix, so we can know both of the status and refunding status by calling ```@book.status_dispatch?``` and ```@book.refund_dispatch?```.