Sha256: 3ac358da025b7538966d3cbb814ce7f203876f0c50e60a33bf3e430b473f8fe5

Contents?: true

Size: 441 Bytes

Versions: 4

Compression:

Stored size: 441 Bytes

Contents

require 'pp'
require 'pathname'
require 'rubygems'
require 'adapter/mongo'

root_path = Pathname(__FILE__).dirname.join('..').expand_path
lib_path  = root_path.join('lib')
$:.unshift(lib_path)
require 'toystore'

class User
  include Toy::Store
  store :mongo, Mongo::Connection.new.db('adapter')['testing']

  attribute :name, String
end

user = User.create(:name => 'John')

pp user
pp User.get(user.id)

user.destroy

pp User.get(user.id)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
toystore-0.8.3 examples/mongo.rb
toystore-0.8.2 examples/mongo.rb
toystore-0.8.1 examples/mongo.rb
toystore-0.8.0 examples/mongo.rb