I have an situation where I want to show an each loop of 'updates'. Each update had a game associated with it (game_id). Some times there are updates that have the same game as other updates. How do I modify the loop so that it only shows unique updates? (in the example code below, I don't want to show the same game thumbnail twice)
In the view:
<% current_user.updates.each do |update| %>
<img src="<%= update.game.thumbnail %>" />
<% end %>
In the updates model
belongs_to :user
belongs_to :game
In the game model
has_many :users
has_many :updates
In the user model
has_many :updates