Forum: Ruby on Rails Serialize

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E3a276a4c16a6d3efce7336591ea55bd?d=identicon&s=25 Bruno Alberto (beer)
on 2006-01-24 20:32
HI all,


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









Thanks
9e7c9c07e64a6b7b075097831c360d53?d=identicon&s=25 Bill Katz (Guest)
on 2006-01-24 20:52
(Received via mailing list)
>From the most excellent "Agile Web Development 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' ]
This topic is locked and can not be replied to.