Skip to content

Instantly share code, notes, and snippets.

@shankardevy

shankardevy/sales.ex Secret

Created Jul 8, 2017
Embed
What would you like to do?
defmodule Mango.Sales do
alias Mango.Repo
alias Mango.Sales.Order
def get_cart(id) do
Order
|> Repo.get_by(id: id, status: "In Cart")
end
def create_cart do
%Order{status: "In Cart"} |> Repo.insert!()
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment