title: How to add a non-existant column to a sql query
body: <p>I have a little problem. I'm looking for a way to "add" a column to a sql query.</p>
  
  <p>Actually I sort some product from a table with this order:</p>
  
  <pre>
  @prod = Table.find(:all,{:select=>["id, prod-id, cost"],:conditions=>["something = ? and somethingelse = ?","that thing","that other thing"],:order=>"id DESC"})
  </pre>
  
  <p>Then I put the result of this query into a Table (html) with a form to add the product into a Cart.</p>
  
  <p>The problem comes now. In my Cart the product are like that:</p>
  
  <pre>
  cart: #&lt;Cart:0x00000005ce0a68 @items=[[#&lt;Table id: 6024, prod-id: 907509, cost: 33&gt;]]&gt;
  </pre>
  
  <p>And I need to add a "column" to the data in my cart. To get my Cart like that:</p>
  
  <pre>
  cart: #&lt;Cart:0x00000005ce0a68 @items=[[#&lt;Table id: 6024, prod-id: 907509, cost: 33, quantity: 1&gt;]]&gt;
  </pre>
  
  <p>Here is my Cart:</p>
  
  <pre>
  class Cart
        attr_reader :items
  
        def initialize
          @items = []
          @total_price = 0
        end
  
        def add_product(product)
          @items &lt;&lt; product
          product
        end
  
        def total_price
          @items.sum{ |item| item.prod_pxuttc}
        end
  
        def total_items
          @items.length
        end
      end
  </pre>
  
  <p>I need to not-add any Column to my Table. Because I will have to import data from another Source Database into my Table, and I can't change the Source Database. <em>(Yes it's a stupid process, but that's what my Customer want)</em></p>
  
  <p>I have totaly no idea about how to give name to the process I need to do.</p>
  
  <hr>
  
  <p><strong>[edit]</strong></p>
  
  <p>I found a way to resolve my problem.
  By creating a second table, with the same column plus column quantity, with a default empty row.
  Then I select my product from First Table, the default row from the Second Table, and I put value from product into the variable of the default row. Then I put my new variable into my Cart.</p>
  
  <p>It's a bit tricky but it works.</p>