On Fri, Sep 26, 2008 at 12:38 AM, Frederick Cheung <
[EMAIL PROTECTED]> wrote:
> >
> > But fixing it for has_many :throughs and has_ones is harder.
> >
> I'm not sure why that is ? (well with has_one you test for the
> existance of the appropriate ivar rather than calling loaded? but
> surely it's basically the same ?
>
It was just a bit messy as we need to test for the ivar, then call it's
loaded? - it seems like an unnecessary intrusion of implementation details
of the association proxy classes. So I've introduced a
loaded_#{my_association}? to try and keep it clean.
Incidentally, could someone fill me in on why the associations code does
this:
association = instance_variable_get(ivar) if
instance_variable_defined?(ivar)
instead of just using the ifness of instance_variable_get directly?
#instance_variable_get doesn't seem to define the requested instance
variable as a side-effect, so why do we need to
check instance_variable_defined? explicitly?
Anyway, I've written the patch for has_many, has_one, and belongs_to; HABTM
has unrelated :include bugs, and meanwhile has_many with :through doesn't
seem to do the :includes anyway, so don't need to do anything to them at the
mo.
Could my patches for #1101 and #1110 please be reviewed?
Thanks,
Will
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---