函数nil.email/0在elixir phoenix中是未定义的或私有的

时间:2018-05-08 02:18:57

标签: elixir phoenix-framework

我想知道为什么我会收到此错误以及如何修复。可能是由于数据库中的用户ID冲突?另一件事是这甚至可能不是发出此错误的文件。

enter image description here

Option Explicit
Sub GetAllFilePaths(StartFolder As String, Pattern As String, ByRef allFilePaths As Variant, ByRef allFileNames As Variant)
    Dim FNum As Integer
    Dim mainFolder As Object
    Dim pathFile As String
    Dim subFoldersRecurs As New Collection, SubPath
    Dim SubFilePath As String

    If Right(StartFolder, 1) <> "\" Then StartFolder = StartFolder & "\"

    pathFile = Dir(StartFolder & Pattern)
    Do While Len(pathFile) > 0
        FNum = FNum + 1
        ReDim Preserve allFileNames(1 To FNum)
        ReDim Preserve allFilePaths(1 To FNum)
        allFileNames(FNum) = pathFile
        allFilePaths(FNum) = StartFolder & pathFile
        pathFile = Dir()
    Loop


    SubFilePath = Dir(StartFolder, vbDirectory)
    Do While Len(SubFilePath) > 0
        If SubFilePath <> "." And SubFilePath <> ".." Then
            If (GetAttr(StartFolder & SubFilePath) And vbDirectory) <> 0 Then
                subFoldersRecurs.Add StartFolder & SubFilePath
            End If
        End If
        SubFilePath = Dir()
    Loop

    For Each SubPath In subFoldersRecurs
        GetAllFilePaths CStr(SubPath), Pattern, allFilePaths, allFileNames
    Next SubPath

End Sub

Sub PDFfilestoCollall()
Dim pdfFilePaths() As Variant
Dim pdfFileNames() As Variant

Call GetAllFilePaths("C:\Users\adg\Downloads\test folder of files for ingest\", "*.PDF", pdfFilePaths, pdfFileNames)

Dim CollEntry As Variant
For Each CollEntry In pdfFilePaths
    Debug.Print CollEntry

这是我在评论defmodule MessengyrWeb.UserView do use MessengyrWeb, :view def render("show.json", %{user: user}) do %{ user: user_json(user) } end def user_json(user) do hash_email = :crypto.hash(:md5, user.email) |> Base.encode16 |> String.downcase avatar_url = "http://www.gravatar.com/avatar/#{hash_email}" %{ id: user.id, username: user.username, avatarURL: avatar_url, } end end id: user.id并将user: user.username替换为静态整数后得到的结果。

enter image description here

hash_email

2 个答案:

答案 0 :(得分:1)

我删除了整个数据库并再次运行mix ecto.create && mix ecto.migrate

mix phx.server并创建了一个新的用户帐户。

还使用不同的浏览器进行了测试。所以我清除了之前浏览器的cookie ,现在可以使用了。

答案 1 :(得分:0)

我做了 mix ecto.reset 并且对我有用。