Skip to content

Instantly share code, notes, and snippets.

@ryana

ryana/error.txt

Created Jun 17, 2010
Embed
What would you like to do?
ra:timeline[master*]$ ruby wtf.rb
/Users/ryan/.rvm/gems/ree-1.8.6-20090610/gems/mongo_mapper-0.8.0/lib/mongo_mapper/plugins/associations/one_embedded_proxy.rb:35:in `assign_references': undefined method `_parent_document=' for nil:NilClass (NoMethodError)
from /Users/ryan/.rvm/gems/ree-1.8.6-20090610/gems/mongo_mapper-0.8.0/lib/mongo_mapper/plugins/associations/one_embedded_proxy.rb:19:in `replace'
from /Users/ryan/.rvm/gems/ree-1.8.6-20090610/gems/mongo_mapper-0.8.0/lib/mongo_mapper/plugins/associations.rb:41:in `membership='
from /Users/ryan/.rvm/gems/ree-1.8.6-20090610/gems/mongo_mapper-0.8.0/lib/mongo_mapper/plugins/keys.rb:260:in `send'
from /Users/ryan/.rvm/gems/ree-1.8.6-20090610/gems/mongo_mapper-0.8.0/lib/mongo_mapper/plugins/keys.rb:260:in `load_from_database'
from /Users/ryan/.rvm/gems/ree-1.8.6-20090610/gems/bson-1.0.2/lib/../lib/bson/ordered_hash.rb:72:in `each'
from /Users/ryan/.rvm/gems/ree-1.8.6-20090610/gems/bson-1.0.2/lib/../lib/bson/ordered_hash.rb:72:in `each'
from /Users/ryan/.rvm/gems/ree-1.8.6-20090610/gems/mongo_mapper-0.8.0/lib/mongo_mapper/plugins/keys.rb:258:in `load_from_database'
from /Users/ryan/.rvm/gems/ree-1.8.6-20090610/gems/mongo_mapper-0.8.0/lib/mongo_mapper/plugins/keys.rb:161:in `initialize'
from /Users/ryan/.rvm/gems/ree-1.8.6-20090610/gems/mongo_mapper-0.8.0/lib/mongo_mapper/plugins/dirty.rb:43:in `initialize'
from /Users/ryan/.rvm/gems/ree-1.8.6-20090610/gems/mongo_mapper-0.8.0/lib/mongo_mapper/plugins/sci.rb:26:in `initialize'
from /Users/ryan/.rvm/gems/ree-1.8.6-20090610/gems/mongo_mapper-0.8.0/lib/mongo_mapper/plugins/keys.rb:62:in `new'
from /Users/ryan/.rvm/gems/ree-1.8.6-20090610/gems/mongo_mapper-0.8.0/lib/mongo_mapper/plugins/keys.rb:62:in `load'
from /Users/ryan/.rvm/gems/ree-1.8.6-20090610/gems/mongo_mapper-0.8.0/lib/mongo_mapper/plugins/querying/decorator.rb:29:in `first'
from /Users/ryan/.rvm/gems/ree-1.8.6-20090610/gems/mongo_mapper-0.8.0/lib/mongo_mapper/plugins/querying.rb:154:in `find_one'
from /Users/ryan/.rvm/gems/ree-1.8.6-20090610/gems/mongo_mapper-0.8.0/lib/mongo_mapper/plugins/querying.rb:13:in `find'
from wtf.rb:24
require 'rubygems'
require 'mongo_mapper'
MongoMapper.database = 'wtf'
class User
include MongoMapper::Document
has_one :membership
end
class Membership
include MongoMapper::EmbeddedDocument
belongs_to :user
end
User.delete_all
a = User.create :membership => Membership.new
User.find a.id
b = User.create
User.find b.id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment