I am cheap and in an attempt to learn about rails & relationships I’m
trying to create an application that my friends and I can use as a way
to split the cost of items we buy @ Costco.
Right now the models i have are:
User - Various people involved
Run - Represents Costco runs
Item - Individual items purchased during a Costco run
I was hoping that someone could point me in the right direction as to
how i setup up the relationships…
These are my models:
An item is purchased on a run and it’s cost can be split between many
Users. Because many Users can split the cost of an Item, it is owned by
1 or more Users.
A run is an individual trip to costco. On a run many items are
A User can participate in many runs and during the run will be buying
Items (or maybe buying a fraction of 1 item).
has_many :items, :through => :participations #This is my area of
I realize this is incorrect as is, but could someone shed some light on
how i should be thinking about a situation like this?
Thanks for your time and for reading a big post like this