Skip to content

Commit

Permalink
Fix best deals with unreleased games
Browse files Browse the repository at this point in the history
  • Loading branch information
Calyhre committed May 16, 2017
1 parent 9fcd679 commit 17d30ab
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def best_deals
games.each do |code, games|
game = games.first
lowest = games.flat_map(&:prices).min_by { |price| price.value.exchange_to('USD') }
next if !lowest.present?
rates = currencies.map { |c| lowest.value.exchange_to(c) }
rows << [game.title, lowest.country].concat(rates)
end
Expand Down

0 comments on commit 17d30ab

Please sign in to comment.