Fix RentablePurchases, which saved the wrong customer_id
[cs356-p2-videostore.git] / app / controllers / purchase_controller.rb
index 0f7e22f..1c40069 100644 (file)
@@ -148,7 +148,7 @@ class PurchaseController < ApplicationController
 
       # Actually record the purchase
       purchase = RentablePurchase.new
-      purchase.customer_id = session[:customer_id]
+      purchase.customer_id = session[:customer_id][0]
       purchase.date = Time.now.to_date
       purchase.price = @rentable.calculated_price
       purchase.rentable = @rentable