Hello, trying to construct the following query using ROM
select repos.*,
json_agg(row_to_json(reports.*)) as reports
from repos
left join reports on
repos.id = reports.repo_id
group by repos.id;
However when constructing the query I’m getting
undefined method `meta' for #<Module:0x00000000064a9830>
file: attribute.rb location: meta line: 309
and my query looks like
select { [:id, :name, array::json_agg(json::row_to_json(:reports__id, :reports__name)) ] }
.left_join(reports, repo_id: :id).group(:id)
Anyone have any ideas?