ミドル
2026年8月19日

バグを見つけろ:Ruby on Rails

コードは1つ。バグを見つけるか、バグがないことを示してください。

ruby
1class CartCalculator
2  def total_with_discount(items, discount_rate)
3    subtotal = items.sum(&:price)
4    discount = subtotal * discount_rate
5    subtotal - discount
6  end
7end

問題のある行をクリックしてください。

あなたの判断

1日1回まで。回答するとすぐに正解が表示されます。

連続記録を守る

アカウントを作成すると連続記録を保存し、進捗を追跡できます。

アカウントを作成