I have Hanami models User and UserInfo that have has_one association.
Repositories look the following:
class UserInfoRepository < Hanami::Repository
end
class UserRepository < Hanami::Repository
associations do
has_one :user_info
end
end
Question: who can I join and load both tables with one query? (I am looking for something similar to Rails' includes).
So far I've tried
def users_with_info
users.join(:user_info)
end
It does the join, but does not select columns from user_infos table.
Thanks in advance.