# Model design question

**URL:** <https://www.ruby-forum.com/t/model-design-question/119201>\
**Category:** Rails\
**Created:** [November 4, 2007, 10:03pm UTC](https://www.ruby-forum.com/t/model-design-question/119201 "2007-11-04T22:03:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![appleate](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/6bbea6/32.png) [@appleate](https://www.ruby-forum.com/u/appleate)\
**Post date:** [November 4, 2007, 10:03pm UTC](https://www.ruby-forum.com/t/model-design-question/119201/1 "2007-11-04T22:03:07Z")

</div>

Hi all! I have to build a webapp for a friends GYM. I’ve done basic  
stuff before with rails, but just need to clarify something before I  
start this.

The site will have a top-level model for the GYM, and under that I need  
models to represent the equipment that will be loaned out, customers  
etc.  
so gym-\>has\_many-\>items  
where I’m getting stuck though, is that each Item isn’t really a model  
itself.  
I.E a loanable item has many sub-items, which represent the version  
(serial number,qty of this version,loaned to, etc) of the actual item.  
So would the models be:

gym,item,version,customer:

gym :has\_many=\>:items  
item :has\_many=\>:versions  
version :has\_one=\>customer

i want the item model to have a current stock level thoguh, for example.  
Would that just be a case of adding a qty method to its model and  
iterating through each of its children?

thanks for reading!
