$: << File.dirname(__FILE__)
require 'connect'

require 'rubygems'
require_gem 'activerecord'
require 'pp'

#START:class
class Purchase < ActiveRecord::Base
  serialize :last_five
  # ...
end
#END:class

#START:save
purchase = Purchase.new
purchase.name = "Dave Thomas"
purchase.last_five = [ 'chaussures', 'chemise', 'chaussettes', 'masque de ski', 'shorts' ]
purchase.save
#END:save

#START:read
purchase = Purchase.find_by_name("Dave Thomas")
pp purchase.last_five
pp purchase.last_five[3]
# END:read
