Associations: Should "parent" and "parent.children.first.par

Because it’s not, they have totally different object_ids. But should
they be pointing to the same object?

On 2/5/07, inkling [email protected] wrote:

Because it’s not, they have totally different object_ids. But should
they be pointing to the same object?

Should be, assuming the current record is the first child of the
parent. However, there’s no identity cache for AR, so they will be
different ruby objects.


Rick O.
http://weblog.techno-weenie.net
http://mephistoblog.com

Ahh, I wasn’t clear, but you answered my question. Thanks!

Yes they point to the same record in the database, but yes I just
wanted to make sure it was expected they are different ruby objects.

Are there any plans for doing some identity caching in the future or
has there been some discussion that it is ideal for “parent” and
“parent.children.first.parent” to be different ruby objects?

On 2/5/07, inkling [email protected] wrote:

Ahh, I wasn’t clear, but you answered my question. Thanks!

Yes they point to the same record in the database, but yes I just
wanted to make sure it was expected they are different ruby objects.

Are there any plans for doing some identity caching in the future or
has there been some discussion that it is ideal for “parent” and
“parent.children.first.parent” to be different ruby objects?

No plans. There’s been some discussions on it though. Simple
identity caches are easy, but it gets pretty complex pretty quickly.
It’s usually not a big deal with most web apps I guess.


Rick O.
http://weblog.techno-weenie.net
http://mephistoblog.com