onyxframework / sql

A delightful SQL ORM ☺️
https://api.onyxframework.com/sql
MIT License
91 stars 7 forks source link

Auto-select self by default on joining #73

Closed vladfaust closed 5 years ago

vladfaust commented 5 years ago
Post.first.select(Post).join(author: true) { |x| x.select(:name) }

Currently the developer has to explicitly add .select(Post), otherwise the post isn't loaded. By it should be loaded by default unless explicitly called .select. However, .join can be called at any time, even before parent query .select, therefore some kind of @select_self : Bool = true variable should be introduced in the Query.