From ba2eb13de0fd3f57adeb88d6e0cf84a3241dc132 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Wed, 28 Aug 2019 12:41:44 -0400 Subject: [PATCH] context: comments --- lib/philomena/comments/comment.ex | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/philomena/comments/comment.ex b/lib/philomena/comments/comment.ex index 584003ff..59a01795 100644 --- a/lib/philomena/comments/comment.ex +++ b/lib/philomena/comments/comment.ex @@ -3,7 +3,23 @@ defmodule Philomena.Comments.Comment do import Ecto.Changeset schema "comments" do - timestamps() + belongs_to :user, Philomena.Users.User + belongs_to :image, Philomena.Images.Images + belongs_to :deleted_by, Philomena.Users.User + + field :body, :string + field :ip, EctoNetwork.INET + field :fingerprint, :string + field :user_agent, :string, default: "" + field :referrer, :string, default: "" + field :anonymous, :boolean, default: false + field :hidden_from_users, :boolean, default: false + field :edit_reason, :string + field :deletion_reason, :string, default: "" + field :destroyed_content, :boolean, default: false + field :name_at_post_time, :string + + timestamps(inserted_at: :created_at) end @doc false