Serialize


#1

HI all,

I not understand a method serialize.
Anyone have any example using de serialize…

Thanks


#2

From the most excellent “Agile Web D. with Rails” book, p. 206:

class Purchase < ActiveRecord::Base
serialize :last_five

end

purchase = Purchase.new
purchase.last_five = [ ‘shoes’, ‘shirt’, ‘socks’, ‘ski mask’, ‘shorts’ ]