# Storing different types of data in 1 model

**URL:** <https://www.ruby-forum.com/t/storing-different-types-of-data-in-1-model/130122>\
**Category:** Rails\
**Created:** [February 25, 2008, 4:13pm UTC](https://www.ruby-forum.com/t/storing-different-types-of-data-in-1-model/130122 "2008-02-25T16:13:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tarscher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@Tarscher](https://www.ruby-forum.com/u/Tarscher)\
**Post date:** [February 25, 2008, 4:13pm UTC](https://www.ruby-forum.com/t/storing-different-types-of-data-in-1-model/130122/1 "2008-02-25T16:13:24Z")

</div>

Hi all,

I’m creating a statistics system for events. When an event has passed,  
an admin can enter statistics for that passed event. Every user  
attending the event and the event itself have statistics. The problem  
is that depending on the type of the event, the type of statistics for  
both users and event can change. eg: for one event the number of  
remarks and time present will be registered for another event the name  
of the company he represents

I’m struggling on how to implement this especially database wise. I  
can ofcourse create a table that contains all possible statistics data  
and than only fill in the rows that matter for that event. the  
downside is that I lose a lot of storage since a lot of rows are left  
blanc.

maybe someone has an idea on how to solve this?

thanks in advance.  
Stijn
