Hi,
I have a serialized Hash in a database. How can I acces my data? data is stored as a varchar and text.
Hi,
I have a serialized Hash in a database. How can I acces my data? data is stored as a varchar and text.
Did you use ActiveRecord's serialization?
class MyModel < ActiveRecord::Base serialize :data, Hash end
If so, you can simple call from your model to get your hash back.
mymodel = MyModel.find(prams[:id]) myhash = mymodel.data field1 = myhash[:field1]
Thank you, Glen