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


#1

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


#2

On 2/5/07, inkling removed_email_address@domain.invalid 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


#3

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?


#4

On 2/5/07, inkling removed_email_address@domain.invalid 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