On 15 June 2010 13:46, Adam Akhtar <[email protected]> wrote:
>
>>
>> Can anyone confirm if this is a limitation of the framework?
>
> anyone????

You said in your first post that it *didn't* work trying to do a
:though on a :has_one. So as far as I can see you have three choices:

  1) Fudge it with a :has_many that you manually check only has one
associated - messy, as Marnen pointed out.

  2) Add the method I suggested to do the collect yourself (I default
to using .inject, which is quite verbose... you could do the same
thing with .map, which would remove the references to 'memo'). If the
functionality *was* in Rails, it would be doing something similar in
the background...

  3) Patch Rails yourself to support going through a :has_one - look
at the source of :has_many and see what it's missing.


Personally, I'd do what I suggested (well, I would wouldn't I! ;-)  as
you can't expect the framework to do *everything* for you, and helpers
like :through only come about when loads of people need to do the same
thing frequently.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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-talk?hl=en.

Reply via email to