What about something like (not real code, just trying to convey the 
idea):

Item (id, name)
  # an item is an item. given that you'll probably
  # purchase the same item more than once, you could
  # generate an Item list as a shopping list for your
  # next Costco binge
  has_many purchases

Purchase (id, item_id, run_id, amount)
  # on a run, you bought some item that cost some
  # amount, and someone's gonna pay
  belongs_to item
  belongs_to run
  has_many shares

Run (id, datetime?)
  # on this particular run, someone made some number of
  # purchases (User seems incidental to a run, important
  # only through its participation in shares)
  has_many purchases

Share (id, user_id, purchase_id, percent)
  # the cost of each purchase can be divided between
  # one or more users
  belongs_to user
  belongs_to purchase

User(id, name)
  # each user can participate in any number of runs, and
  # would thereby be liable for some shares
  has_many shares

-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to