Tom Tom wrote:
> hi, i think u didnt understand my question:
>
> how do i get ALL roots PLUS all descendants in one go?
I remember that there's a way to do this (besides find :all), but you'll
have to check the docs. If you can't find it after reading the docs,
let me know.
>
>
> res = Category.find(all, conditions{parent_id IS NULL})
> res.descendants
>
>>> descendants works only on a result of size of 1
Of course. res is an Array, while descendants is defined on Category.
>
> regs
Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---