I am currently implementing a web application similar to Twitter. In my Twitter application I have an action 'retweet' which obviously is also in the real twitter.
How I thought of implementing it ?
I will have a model with the following columns:
- 1. retweeted_tweet_id(which tweet was retweeted)
- 2. who_user_id(who retweeted it)
- 3. retweeted_at(time when it was retweeted)
  All good and well. When I will have to return all tweets I will just have to use the '+' to concatenate 2 arrays(one that contains tweets and one that contains retweets). This action will show the tweets in chronological order but I won't be able to add "retweeted by username" unless I query again the Retweets model by tweet_id and retweeted_at time(the time of the tweet != retweeted_at_time) to actually confirm that that tweet is a retweet. After corfirming it's a retweet I add the "This post was retweed by username
  This brings me to my questions: Is there a simpler way to do this ? I can't think of any other way using this model. Is there a more efficient model ?
and in it to write retweeted by username but this only for retweets . How do I verify if a tweet is the original tweet or a retweet without querying after tweet_id and created_at ? . A must is ordering all the tweets and retweets that are show in the page in chronological order. (this is what their query does)
– Lucian Tarna Feb 12 '15 at 10:39