You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simple way to reproduce it is with following test in this repository:
class User < ActiveRecord::Base
enumerize :status, :in => { active: 1, blocked: 2 }, scope: true
end
...
it 'has correct value in _was attribute in child class' do
class AdminUser < User
enumerize :status, :in => { active: 1, blocked: 2, inactive: 3 }, scope: true
end
admin = AdminUser.create(status: 'active')
admin.update status: 'blocked'
expect(admin.status_was).must_equal 'active'
end
admin.status_was was returning "blocked" as Enumerize::Value before fix in #448. Now it returns 2 (as Integer).
I looked at the code but could not figure out how to fix this without breaking the mentioned fix. I will probably try more some time later when I have time again. Or if you could point me to the right direction I would be happy to prepare PR.
The text was updated successfully, but these errors were encountered:
Simple way to reproduce it is with following test in this repository:
admin.status_was
was returning"blocked"
as Enumerize::Value before fix in #448. Now it returns2
(as Integer).I looked at the code but could not figure out how to fix this without breaking the mentioned fix. I will probably try more some time later when I have time again. Or if you could point me to the right direction I would be happy to prepare PR.
The text was updated successfully, but these errors were encountered: