Revision d8e6bbea3275 () - Diff

Link to this snippet: https://friendpaste.com/2ZMho7WuSbOGLeIvDcP6qm
Embed:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require 'rubygems'
require 'relaxdb'

class CD < RelaxDB::Document
property :title
property :tracks
end

thp = CD.new(:title => "The Holy Pictures")
tracks = []
tracks << {"title" => "I Heard Wonders", "length" => "5:35"}
tracks << {"title" => "Story Of The Ink", "length" => "5:23"}
thp.tracks = tracks
thp.save

thp = RelaxDB.load(thp._id)
puts thp.tracks[1]["title"]