Skip to content

Commit

Permalink
commented non-obvious game_night one liner
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhutch committed Apr 2, 2013
1 parent 1fd086d commit 0ae7e3b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/models/night.rb
Expand Up @@ -8,6 +8,9 @@ def owned_games
for user in self.users do
game_arr << user.games
end
# fun little one liner to remove to duplicates
# inject steps through the game_arr and does a union with itself
# on each element of game_arr
game_arr.inject(game_arr.first) { |f,x| f = f | x }
end

Expand Down

0 comments on commit 0ae7e3b

Please sign in to comment.