Last active
October 15, 2015 19:17
-
-
Save stueccles/f13624bfd8f2c450f157 to your computer and use it in GitHub Desktop.
Select a single row from an Ecto association
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def line_item_query(order, variant_id) do | |
from l in assoc(order, :line_items), | |
where: l.variant_id == ^variant_id, | |
select: l | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment