[Nitro] temporary database structures

Bill Kelly billk at cts.com
Wed Jun 14 17:42:07 EDT 2006

From: "Jonas Pfenniger" <zimba.tm at gmail.com>
> Maybe you should store those datas in session since they're already
> garbage-collected.

I guess I could.  It seems this would require me to have two
different methods of accessing my data.

In my case, I have some nested has_many relationships:

  class Registration

  class Address

  class Product

  class LineItem
    has_many :registrations, Registration
    has_one :product, Product

  class Order
    has_one :billing_address, Address
    has_one :shipping_address, Address
    has_many line_items, LineItem

What I'd like to avoid, is having two different ways of
iterating through the Order to find the LineItems, etc.

It seems if I were to store incomplete orders in session,
I would need one set of code to render the cart for partial
orders, vs. different code to render the cart for completed
orders stored in the database.

I think it would be nice to have a single way to access
my data, whether the orders are incomplete or complete.
Thus it seemed natural to me to want to store temporary
data in the database.

Does that make sense?  Or am I making too big a deal of
only wanting one way to access my data?



More information about the Nitro-general mailing list