#449 ✓resolved
Aadi Deshpande

Save/Create fails to work when dealing with belongs_to relationships from inside model

Reported by Aadi Deshpande | July 7th, 2008 @ 05:40 PM

It seems that when trying to create model entities from within a model itself fails when dealing with "belongs_to" type entities.

The attached spec shows 2 examples:

In the first, spawn_evil_twin, i attempt to reuse attributes from my model to create the new ,model.

In that scenario, the foreign key relationship(s) fail(s) to be saved, leaving both FK entities as nil.

In the second is a hack, where I "re-get" the model using the local attribute's id, which does save properly.

Is this a bug? Is there a rationale for this?

I'm not sure if this has anything to do with the IdentityMap not being primed properly, but seems like it should work as expected.

Thanks,

-a

Comments and changes to this ticket

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 »

People watching this ticket

Pages