Given the following schema:
schema "invoices" do
embeds_many :items, InvoiceItem
timestamps()
end
And the embedded schema
embedded_schema do
field :name, :string
field :amount, :integer
field :price, :integer
end
How can I query for items with a given name? I can’t seem to get it working.
I tried fragments, joins, apparently lateral joins aren’t supported directly but can be used in a different form using subqueries, but I’m afraid I don’t see how.
Can anyone shed some light? This can’t be such an obscure usecase