diff --git a/rails6/en/chapter07-placing-orders.adoc b/rails6/en/chapter07-placing-orders.adoc index c4f3384..3358b1e 100644 --- a/rails6/en/chapter07-placing-orders.adoc +++ b/rails6/en/chapter07-placing-orders.adoc @@ -504,7 +504,7 @@ We can now add the implementation: class Order < ApplicationRecord # ... def set_total! - self.total = products.sum :price + self.total = self.products.map(&:price).sum end end ---- diff --git a/rails6/es/chapter07-placing-orders.adoc b/rails6/es/chapter07-placing-orders.adoc index 50db52f..944ee90 100644 --- a/rails6/es/chapter07-placing-orders.adoc +++ b/rails6/es/chapter07-placing-orders.adoc @@ -503,7 +503,7 @@ Ahora podemos añadir la implementación: class Order < ApplicationRecord # ... def set_total! - self.total = products.sum :price + self.total = self.products.map(&:price).sum end end ---- diff --git a/rails6/fr/chapter07-placing-orders.adoc b/rails6/fr/chapter07-placing-orders.adoc index f6bfdfe..eb2f623 100644 --- a/rails6/fr/chapter07-placing-orders.adoc +++ b/rails6/fr/chapter07-placing-orders.adoc @@ -489,7 +489,7 @@ Nous pouvons maintenant ajouter l'implémentation: class Order < ApplicationRecord # ... def set_total! - self.total = self.products.sum :price + self.total = self.products.map(&:price).sum end end ----