#28 new
Justin D-Z

set_default on new object copies hash from existing object

Reported by Justin D-Z | December 23rd, 2008 @ 09:07 AM

I have a CouchRest Model object and use set_default to create an empty hash on the object when I create an instance. If I create an instance, I get the empty hash. Then I put an item in the hash. Then I create a brand new instance of the model object and that new instance magically has the item in its supposedly empty hash as was added to the prior object.

Code + irb session that duplicates the problem: http://pastie.org/345576

Email me if you want the source files or want me to go through an example interactively.

No comments found

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

"CouchDB, close to the metal." <a href="http://github.com/jchris/couchrest/tree/master">CouchRest</a> is a RESTful layer for accessing CouchDB, based off CouchDB's included Javascript reference client. CouchRest also includes helpers for running large queries etc. There is also a base class for ActiveRecord / Datamapper style ORM, called CouchRest::Model.

People watching this ticket