Class: Comee::Core::ReceivedItem
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Comee::Core::ReceivedItem
- Defined in:
- app/models/comee/core/received_item.rb
Instance Method Summary collapse
Instance Method Details
#check_quantity_received ⇒ Object
17 18 19 |
# File 'app/models/comee/core/received_item.rb', line 17 def check_quantity_received errors.add(:quantity_received, "can't be greater than quantity ordered") if quantity_received.to_i > quantity_ordered.to_i end |
#update_total_price ⇒ Object
12 13 14 15 |
# File 'app/models/comee/core/received_item.rb', line 12 def update_total_price self.total_price ||= 0 self.total_price = unit_price * quantity_received end |