Added timestamps to tweets and they organize by newest on top
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user