Created
December 9, 2016 04:23
-
-
Save landongn/5d4e01270b35310f084208332d753d4b 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
| def new_character(struct, params \\ %{}) do | |
| struct | |
| |> cast(params, [:name, :player_id, :class_id]) | |
| |> validate_required([:name, :class_id, :player_id]) | |
| |> cast_assoc(:class, required: true) | |
| |> cast_assoc(:player, required: true) | |
| end |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Error: