Sha256: ebed01f13c3eddae02a5526fd55505031b5032e3de296cff445e35ce1f07a041

Contents?: true

Size: 443 Bytes

Versions: 9

Compression:

Stored size: 443 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
  adapter :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

9 entries across 9 versions & 1 rubygems

Version Path
toystore-0.13.0 examples/mongo.rb
toystore-0.12.0 examples/mongo.rb
toystore-0.11.0 examples/mongo.rb
toystore-0.10.4 examples/mongo.rb
toystore-0.10.3 examples/mongo.rb
toystore-0.10.2 examples/mongo.rb
toystore-0.10.1 examples/mongo.rb
toystore-0.10.0 examples/mongo.rb
toystore-0.9.0 examples/mongo.rb