Advertisement
Guest User

model LineItem

a guest
Feb 23rd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.17 KB | None | 0 0
  1. class LineItem < ApplicationRecord
  2.   belongs_to :order, optional: true
  3.   belongs_to :product
  4.   belongs_to :cart
  5.   def total_price
  6.     product.price * quantity
  7.   end
  8. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement