Last active
September 1, 2016 20:44
-
-
Save marick/5e0e589701e70da9a0074254af8bee15 to your computer and use it in GitHub Desktop.
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
| # Elixir Ecto. Make a new reservation for a set of (already existing) animals and procedures | |
| def insert_new!(reservation_fields, animals, procedures) do | |
| uses = for a <- animals, p <- procedures, do: %OldUse{animal: a, procedure: p} | |
| only_group = %OldGroup{uses: uses} | |
| reservation = %{reservation_fields | groups: [only_group]} | |
| Eecrit.OldRepo.insert!(reservation) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment