From: Ira W. Snyder Date: Mon, 26 Nov 2007 08:16:21 +0000 (-0800) Subject: Fix RentablePurchases, which saved the wrong customer_id X-Git-Tag: turned-in~27 X-Git-Url: https://www.irasnyder.com/gitweb/?p=cs356-p2-videostore.git;a=commitdiff_plain;h=f102e2d11bd1633579c7cfc244a38a9d8929bd06 Fix RentablePurchases, which saved the wrong customer_id Signed-off-by: Ira W. Snyder --- diff --git a/app/controllers/purchase_controller.rb b/app/controllers/purchase_controller.rb index 0f7e22f..1c40069 100644 --- a/app/controllers/purchase_controller.rb +++ b/app/controllers/purchase_controller.rb @@ -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 diff --git a/app/views/purchase/list.rhtml b/app/views/purchase/list.rhtml index b702f7f..6887d13 100644 --- a/app/views/purchase/list.rhtml +++ b/app/views/purchase/list.rhtml @@ -3,7 +3,6 @@ - @@ -13,7 +12,6 @@ <% for purchase in @purchases %> - diff --git a/db/development.sqlite3 b/db/development.sqlite3 index f826509..332cbaf 100644 Binary files a/db/development.sqlite3 and b/db/development.sqlite3 differ
DateQuantity Type Title Price
<%=link_to purchase.date, :action => 'filterbydate', :id => purchase.date %><%=h purchase.quantity %> <%=link_to purchase.class, :action => 'filterbytype', :id => purchase.type %> <%=h purchase.title %> <%=h purchase.price %>