Sha256: 3881ecfe60b42864283091da5273ee778dfff3eb4f7a27349f6975602e5f185b
Contents?: true
Size: 684 Bytes
Versions: 5
Compression:
Stored size: 684 Bytes
Contents
#!/usr/bin/env ruby -rubygems require File.dirname(__FILE__) + '/authentication' # fetch the collection first guidebook_collection = StorageRoom::Collection.find('4dda7761b65245fde100005d') category_collection = StorageRoom::Collection.find('4dda7761b65245fde100001a') category = category_collection.entries.resources.first # find the first category guidebook = guidebook_collection.entry_class.new(:title => 'Bar', :price => 2.23, :category => category, :tags => ['tag1', 'tag2']) if guidebook.save # save the guidebook with the associated category puts "Guidebook Entry saved (#{guidebook[:@url]})" else puts "Guidebook could not be saved: #{entry2.errors.join(', ')}" end
Version data entries
5 entries across 5 versions & 1 rubygems