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
defmodule MyApp.Post do | |
use Arango.Document | |
schema "posts" do | |
..... | |
def changeset(...) | |
# stuff for validation | |
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
defmodule Post do | |
schema "posts" do | |
field :_id, :string | |
field :_key, :string | |
field :_data, :map | |
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
assembliesDecoder : Decode.Decoder (List Assembly) | |
assembliesDecoder = | |
field "result" (Decode.list (Decode.dict Decode.string)) | |
-- or -- | |
assembliesDecoder : Decode.Decoder (List Assembly) | |
assembliesDecoder = | |
field "result" <| | |
Decode.list <| |
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
query : Http.Body | |
query = | |
Encode.object | |
[ ( "query", Encode.string "FOR assy IN assemblies FILTER assy.parent_id == NULL LIMIT 100 RETURN assy" ) | |
, ( "batchSize", Encode.int 100 ) | |
] | |
|> Http.jsonBody |
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
authenticate : Model -> Cmd Msg | |
authenticate model = | |
let | |
url = | |
Endpoint.authUrl | |
|> Debug.log ("url") | |
body = | |
Http.jsonBody (credentials model) |
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
update : Msg -> Model -> ( Model, Cmd Msg ) | |
update msg model = | |
case msg of | |
SetUsername username -> | |
{ model | username = username } ! [] | |
SetPassword password -> | |
{ model | password = password } ! [] | |
SetDb db -> |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Arango Elm</title> | |
<!-- MDL --> | |
<link href='https://fonts.googleapis.com/css?family=Roboto:400,300,500|Roboto+Mono|Roboto+Condensed:400,700&subset=latin,latin-ext' rel='stylesheet' type='text/css'> | |
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> | |
<link rel="stylesheet" href="https://getmdl.io/material.teal-red.min.css" /> |
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
[ | |
{ | |
"_key": "3210959", | |
"_id": "assemblies/3210959", | |
"_rev": "_Uvsu1GG--_", | |
"id": "30.70", | |
"name": "30.70 Walls", | |
"parent_id": "30" | |
}, | |
{ |
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
module Tests (..) where | |
import ElmTest exposing (..) | |
import Json.Decode as Decode | |
import Json.Encode as Encode | |
import Check exposing (Claim, Evidence, check, claim, that, is, for) | |
import Check.Producer exposing (..) | |
import Check.Test exposing (evidenceToTest) | |
import String | |
import Ober exposing (..) |