我编写了以下查询:
MyApp.Repo.all(from a in MyApp.Assignment, join: c0 in assoc(a, :client), join: c1 in assoc(c0, :company_detail), where: c1.holding_company == "Sample", select: a)
我收到此错误could not find association` company_detail` on schema MyApp.Client
。
:company_detail
是一种以以下方式与:client
相关的嵌入式架构:
defmodule MyApp.Client do
use MyApp.Web, :model
use Arc.Ecto.Schema
schema "clients" do
embeds_one(:company_details, MyApp.CompanyDetail, on_replace: :delete)
end
end