Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* we are on our way * wip * fixed create board * wip * . * wip * . * . * yay * ok
- Loading branch information
Showing
25 changed files
with
398 additions
and
97 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import EctoEnum | ||
defenum(BoardRoleEnum, owner: 0, contributor: 1, observer: 2) |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
defmodule Lucidboard.BoardRole do | ||
@moduledoc "Schema for role a user has on a board" | ||
use Ecto.Schema | ||
alias Ecto.UUID | ||
alias Lucidboard.{Board, User} | ||
|
||
@primary_key {:id, :binary_id, autogenerate: false} | ||
# @derive {Jason.Encoder, only: ~w(id)a} | ||
|
||
schema "board_roles" do | ||
belongs_to(:board, Board) | ||
belongs_to(:user, User) | ||
field(:role, BoardRoleEnum) | ||
end | ||
|
||
@spec new(keyword) :: Like.t() | ||
def new(fields \\ []) do | ||
defaults = [id: UUID.generate()] | ||
struct(__MODULE__, Keyword.merge(defaults, fields)) | ||
end | ||
end |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.