Fix RentablePurchases, which saved the wrong customer_id
authorIra W. Snyder <devel@irasnyder.com>
Mon, 26 Nov 2007 08:16:21 +0000 (00:16 -0800)
committerIra W. Snyder <devel@irasnyder.com>
Mon, 26 Nov 2007 08:16:21 +0000 (00:16 -0800)
Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
app/controllers/purchase_controller.rb
app/views/purchase/list.rhtml
db/development.sqlite3

index 0f7e22f..1c40069 100644 (file)
@@ -148,7 +148,7 @@ class PurchaseController < ApplicationController
 
       # Actually record the purchase
       purchase = RentablePurchase.new
 
       # 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
       purchase.date = Time.now.to_date
       purchase.price = @rentable.calculated_price
       purchase.rentable = @rentable
index b702f7f..6887d13 100644 (file)
@@ -3,7 +3,6 @@
 <table border="1">
   <tr>
     <th>Date</th>
 <table border="1">
   <tr>
     <th>Date</th>
-    <th>Quantity</th>
     <th>Type</th>
     <th>Title</th>
     <th>Price</th>
     <th>Type</th>
     <th>Title</th>
     <th>Price</th>
@@ -13,7 +12,6 @@
 <% for purchase in @purchases %>
   <tr>
     <td><%=link_to purchase.date, :action => 'filterbydate', :id => purchase.date %></td>
 <% for purchase in @purchases %>
   <tr>
     <td><%=link_to purchase.date, :action => 'filterbydate', :id => purchase.date %></td>
-    <td><%=h purchase.quantity %></td>
     <td><%=link_to purchase.class, :action => 'filterbytype', :id => purchase.type %></td>
     <td><%=h purchase.title %></td>
     <td><%=h purchase.price %></td>
     <td><%=link_to purchase.class, :action => 'filterbytype', :id => purchase.type %></td>
     <td><%=h purchase.title %></td>
     <td><%=h purchase.price %></td>
index f826509..332cbaf 100644 (file)
Binary files a/db/development.sqlite3 and b/db/development.sqlite3 differ