I use serialize
in one ActiveRecord model to serialize an Array of simple Hashes into a text database field. I even use the second parameter to coerce deserialization into Arrays.
class Shop < ActiveRecord::Base
serialize : recipients, Array
end
It seems to work fine but, after a few requests, the content of recipients
turns to HashOfIndifferentAccess hashes instead of arrays. This only happens after a few reloads of the models and I haven't been able to reproduce it in tests or the console, only in production environment.