# Vind de bug: Ruby on Rails > Eén stukje code. Vind de bug, of bewijs dat er geen is. Dagelijkse challenge: 2026-08-19 (UTC) · Mid-Level ```ruby class CartCalculator def total_with_discount(items, discount_rate) subtotal = items.sum(&:price) discount = subtotal * discount_rate subtotal - discount end end ``` ## Jouw oordeel - Beveiligingslek - Logicafout - Codestijl - Geen probleem Eén poging per dag. Het antwoord verschijnt direct daarna. --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/nl/dagelijkse-challenge/ruby-on-rails