I have a method like this, calculating the sub_total in an order model:
result = 0
for item in self.order_items
result += item.price
Is there a rails way to make the method more simple and concise?
Material Science and Engineering
Huazhong University of Science and Technology
Wuhan Hubei Province P.R.China