On Thu, Jan 7, 2021 at 12:25 AM 'Michael Monerau' via sequel-talk < [email protected]> wrote:
> I use `select_all(:teachers)` instead of your `select(*'*teachers.**'*)` > in such case. Sequel then casts the object to the proper `Teacher` model > class, which is what you want I suppose. I don't know if it's the best way. > > I must admit I didn't find the documentation on this matter, and just > realized it works this way (it gets especially messy when the column names > collide, for example `:id` column). At least I didn't make general sense of > the behaviour. > > Jeremy, maybe there is a resource where the details could be learned for > newcomers? Or I missed the place in the doc. I'd be happy to make a doc PR > once I get the grip on the thing. > Selecting all columns in a table is mentioned in the documentation: http://sequel.jeremyevans.net/rdoc/files/doc/querying_rdoc.html#label-Selected+Columns http://sequel.jeremyevans.net/rdoc/files/doc/sql_rdoc.html#label-All+Columns+-28.-2A-29 http://sequel.jeremyevans.net/rdoc/files/doc/object_model_rdoc.html#label-Sequel-3A-3ASQL-3A-3AColumnAll I'm always happy to review documentation PRs if you can find other places where you think it should be mentioned (maybe in one of the sections that discusses joins). Thanks, Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sequel-talk/CADGZSSf79iF%2B3X9ax__GJ_gQCfXu_gQUBno7C7ST3y0WudW3ZA%40mail.gmail.com.
