{ok, vote} ->
IO.inspect(vote)
%{
vote: %App.Votes.Vote{
__meta__: #Ecto.Schema.Metadata<:loaded, "votes">,
id: 10,
value: 1,
user_id: 2,
user: #Ecto.Association.NotLoaded<association :user is not loaded>,
post_id: 6,
post: #Ecto.Association.NotLoaded<association :post is not loaded>,
comment_id: nil,
comment: #Ecto.Association.NotLoaded<association :comment is not loaded>,
inserted_at: ~N[2023-03-20 18:24:01],
updated_at: ~N[2023-03-20 18:24:01]
}
}
[error] GenServer #PID<0.815.0> terminating
** (KeyError) key :id not found in: %{vote: %App.Votes.Vote{__meta__: #Ecto.Schema.Metadata<:loaded, "votes">, id: 10, value: 1, user_id: 2, user: #Ecto.Association.NotLoaded<association :user is not loaded>, post_id: 6, post: #Ecto.Association.NotLoaded<association :post is not loaded>, comment_id: nil, comment: #Ecto.Association.NotLoaded<association :comment is not loaded>, inserted_at: ~N[2023-03-20 18:24:01], updated_at: ~N[2023-03-20 18:24:01]}}
I’m beyond confused currently. Why am I unable to access the ID using vote.id in this situation? I don’t get how the IO.inspect can display the ID and the loaded data can display the ID yet I cannot access it.