# User Created Tables

**URL:** <https://www.ruby-forum.com/t/user-created-tables/116030>\
**Category:** Rails\
**Created:** [October 1, 2007, 6:55pm UTC](https://www.ruby-forum.com/t/user-created-tables/116030 "2007-10-01T18:55:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Glen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8c91f0/32.png) [@Glen](https://www.ruby-forum.com/u/Glen)\
**Post date:** [October 1, 2007, 6:55pm UTC](https://www.ruby-forum.com/t/user-created-tables/116030/1 "2007-10-01T18:55:28Z")

</div>

I have a situation that is a little more complicated than I’m used to  
dealing with. I thought I would see what others thought before I made  
a decision spent a few days and realized I had done something stupid  
and had to start a re-write 😉

I have been asked to create a web-based course evaluation system for  
the Community College I work for. My first response is: No problem,  
that won’t take long at all. Then I learn that a committee gets  
together every year to evaluate the evaluation process (apparently  
they like to change the questions. The problem I see is maintaining  
the relevance of old data after the committee has decided to make  
changes to the evaluation form.

I’m thinking I will have to perform some sort of dynamic table  
creation so that the question/answer data on old evaluations will  
still be sane if the committee makes changes to the questions/format  
of the evaluations in the future.

Does anyone have a better idea for future proofing this thing?

Thanks,  
Glen

---

<div class="post-metadata">

**Author:** ![Glen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8c91f0/32.png) [@Glen](https://www.ruby-forum.com/u/Glen)\
**Post date:** [October 1, 2007, 7:34pm UTC](https://www.ruby-forum.com/t/user-created-tables/116030/2 "2007-10-01T19:34:44Z")

</div>

> I have been asked to create a web-based course evaluation system for  
> the Community College I work for. My first response is: No problem,  
> that won’t take long at all. Then I learn that a committee gets  
> together every year to evaluate the evaluation process (apparently  
> they like to change the questions. The problem I see is maintaining  
> the relevance of old data after the committee has decided to make  
> changes to the evaluation form.

Have a questions table, with a column for year? Then instead of using  
an association against the whole questions table, make your  
associations limited to questions in the current year? That’d work if  
the evaluations are in the middle of the year. Otherwise you’d need an  
application setting to set the current eval year.

```
has_many :current_questions, :class_name => 'Question', conditions

```

=\> [“year = ?”, DateTime.now.year]

Then you could have your current evaluations done against that  
association, and your reporting / previous years still access the base

---

<div class="post-metadata">

**Author:** ![Glen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8c91f0/32.png) [@Glen](https://www.ruby-forum.com/u/Glen)\
**Post date:** [October 1, 2007, 8:04pm UTC](https://www.ruby-forum.com/t/user-created-tables/116030/3 "2007-10-01T20:04:39Z")

</div>

Thanks Jim,

That makes perfect logical sense. I’m obviously not that with it  
today 😉
