Re: Getting nested associations as descending tree nodes

2020-09-09 Thread abhijit nandy
Thanks Jeremy. I really tried to use eager loading but couldn't get my head around it! Are there any more detailed tutorials anywhere that you might know about? Maybe you should write a book! - Abhijit. On Thu, Se

Re: Getting nested associations as descending tree nodes

2020-09-09 Thread Jeremy Evans
On Wednesday, September 9, 2020 at 6:03:53 PM UTC-7, abhijit wrote: > > Hi, > > I have a table with associations to itself in a parent child hierarchy > using parent_id as the foreign key. I can use both the *tree* and the > *rcte_tree* Sequel plugins there. > > I need to get all the children in

Getting nested associations as descending tree nodes

2020-09-09 Thread abhijit
Hi, I have a table with associations to itself in a parent child hierarchy using parent_id as the foreign key. I can use both the *tree* and the *rcte_tree* Sequel plugins there. I need to get all the children in a nested format, so I've written a method like this - class User < Sequel::Model

Re: Dataset#as_hash does a SELECT * even with columns specified?

2020-09-09 Thread Jeremy Evans
On Tuesday, September 8, 2020 at 10:14:17 PM UTC-7, ejt...@gmail.com wrote: > > Hello, > > I've been using Dataset#as_hash with an Array for the value argument > thinking it would it would avoiding fetching the rows in their entirety but > read today here > https://sequel.jeremyevans.net/rdoc/cl