Closed akirill0v closed 10 years ago
I've fixed it in 0826fcb97410b2b5a2cf6042590b14e1722070a4. Please give it a try. Thanks!
PS. #becomes
method creates a new record using new
call. That's why default value (the empty one in this case) is set and cached. So we need to extend #becomes
method to set correct value.
@lest thanks a lot! It works now!
Hi,
I'm using version 0.11.0 and it occurs
class Message < ActiveRecord::Base
extend Enumerize
serialize :devices, Array
enumerize :devices, in: [:ios, :android], multiple: true
end
after I try to save, devices values won't be saved.
m = Message.new(devices: [:ios, :android])
m.save!
@fernandodev I cannot reproduce this issue in tests. I added the test 3cb333526c49a65badd671a1f1638b5f731eb6cb to make sure everything works as expected. Can you please push a test application reproducing it and open a separate issue?
@lest I finally found the error. It was a bad migration generation.
I fixed when I saw the test
Thank you
I'm still having this problem related to this.
enumerize :role, in: [:admin, :trainer, :company], predicates: true, multiple: true, default: :company
after initialization, I can see the role field has :company
value. But after creation, the field becomes empty returning => <Enumerize::Set {}>
When I bring class to the superclass with "becomes" it breaks enumeraize fields. For multiple: true only: