brainspec/enumerize — pull request #145 by CyborgMaster (2014-02-27 04:00:32+00:00)
Title: Equality Operator - Compare to Symbols and Integers

The `==` operator should behave sanely when comparing to symbols and integers.

With the following class:
``` ruby
class Patient < ActiveRecord::Base
extend Enumerize
enumerize :status, in: { inactive: 0, active: 1 }, scope: true
end
```

I can currently run:
``` ruby
Patient.first.status == 'inactive'
```

But will never work and always return false:
```ruby
Patient.first.status == :inactive
Patient.first.status == 0
```

I can assign a enumerized field a symbol (`Patient.first.status = :inactive`) or an integer (`Patient.first.status = 0`), so I should be able to compare against them as well.

This patch allows comparing to symbols and integers.