Added timestamps to tweets and they organize by newest on top

This commit is contained in:
2026-04-01 11:58:12 -04:00
parent ae35600822
commit 0ac0b68029
5 changed files with 193 additions and 7 deletions

View File

@@ -129,6 +129,12 @@ defmodule Mixer.Posts.Tweet do
allow_nil? false
public? true
end
create_timestamp :inserted_at do
public? true
end
update_timestamp :updated_at
end
relationships do
@@ -146,6 +152,12 @@ defmodule Mixer.Posts.Tweet do
has_many :tweet_likes, Mixer.Posts.TweetLike
end
calculations do
calculate :user_email, :string, expr(user.email) do
public? true
end
end
aggregates do
exists :liked_by_me, :tweet_likes do
public? true