Lee Iverson
2007-Apr-13 17:18 UTC
Need some help with some tests for a critical core patch
I''m not that familiar with the fixtures setup in the core code and as a
result have been having problems coming up with a test that can
accompany the following patch. Is there someone who would be willing to
help me put one together?
http://dev.rubyonrails.org/ticket/7459
From the description:
"There''s a problem with eager loading when one of the associations
is nil.
I first noticed it with an :include => [:actor, {:link => :my_links},
{:url_tags => :tag}] on an AR class called Memo. It failed when it
couldn''t find the :my_links on Memo!? Clearly :my_links is wrt. the
Memo#link target (a Link).
So what was causing the problem? Turned out that for one of the Memo
instances the :link association was nil. Fine, it''s an optional
attribute... But when I tracked it down, it was caused by the recursion
in JoinDependency#construct being blocked by the nil value. Since the
recursion is matched by the flattened list of association names in the
join array, it is necessary to complete the recursion (i.e. recurse down
through Link#my_links) even when the instantiated Memo#link value is
nil. We must simply not construct the instantiated associations while so
recursing."
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com
To unsubscribe from this group, send email to
rubyonrails-core-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---