# Znajdź błąd: Ruby on Rails > Jeden fragment kodu. Znajdź błąd albo udowodnij, że go nie ma. Codzienne wyzwanie: 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 ``` ## Twój werdykt - Luka bezpieczeństwa - Błąd logiczny - Styl kodu - Brak problemu Jedna próba dziennie. Odpowiedź pojawi się od razu potem. --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/pl/codzienne-wyzwanie/ruby-on-rails