# Personnel evaluation modeling question

**URL:** <https://www.ruby-forum.com/t/personnel-evaluation-modeling-question/174981>\
**Category:** Rails\
**Created:** [September 5, 2009, 4:54am UTC](https://www.ruby-forum.com/t/personnel-evaluation-modeling-question/174981 "2009-09-05T04:54:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [September 5, 2009, 4:54am UTC](https://www.ruby-forum.com/t/personnel-evaluation-modeling-question/174981/1 "2009-09-05T04:54:28Z")

</div>

I am looking to develop a personnel evaluation web form.

This stuff below is repeated 5 times with different job  
responsibilities and outcomes ina kind table format. What is the most  
efficient way to model this? Make a generic table and create a NEW  
for each one in the controller save action?

* * *

Key Job Responsibility #1 job1  
Desired Outcome(s) outcome 1

Employee Assessment  
Self Assessment Rating:  
Self Assessment Comments:

Supervisor Assessment  
Supervisor Rating:  
Supervisor Comments:

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [September 6, 2009, 4:43am UTC](https://www.ruby-forum.com/t/personnel-evaluation-modeling-question/174981/2 "2009-09-06T04:43:27Z")

</div>

anyone?

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [September 6, 2009, 11:11am UTC](https://www.ruby-forum.com/t/personnel-evaluation-modeling-question/174981/3 "2009-09-06T11:11:32Z")

</div>

2009/9/5 Me [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Desired Outcome(s) outcome 1
> 
> Employee Assessment  
> Self Assessment Rating:  
> Self Assessment Comments:
> 
> Supervisor Assessment  
> Supervisor Rating:  
> Supervisor Comments:

Don’t worry too much about forms and so on yet, think about the  
fundamental objects in your requirement (users and assessments maybe).  
Then think about the relationships, possibly:  
user has\_many assessments  
assessment belongs\_to user  
Then work out what data and rules go in each model, and finally how to  
display and enter the data.

The above is probably not what you want, but those are the sort of  
things you have to think about.

Colin

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [September 6, 2009, 6:55pm UTC](https://www.ruby-forum.com/t/personnel-evaluation-modeling-question/174981/4 "2009-09-06T18:55:41Z")

</div>

I was looking more at how the tables were set up. I have a review table  
that hold the main form data; but the 5 pieces that repeat, I could make  
a  
table for each one but I was thinking there might be a more efficent  
way to  
do it and also make it more flexible so down the road if more sections  
get  
added I would not have to go add another table for that data. I put the  
header info(job role/requirements) into the DB so I could change it  
through  
the form instead of having to go into the code to modify it. Right now  
there are 5 of those sections in the form so I just do a FIND on them  
and  
loop through how many times they are there and display a partial X times  
and  
use the data in the db for the header info to make it relatively  
dynamic.

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [September 6, 2009, 6:56pm UTC](https://www.ruby-forum.com/t/personnel-evaluation-modeling-question/174981/5 "2009-09-06T18:56:52Z")

</div>

2009/9/6 Chris H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> I was looking more at how the tables were set up.Â I have a review table  
> that hold the main form data; but the 5 pieces that repeat, I could make a  
> table for each one but I was thinking there might be a more efficentÂ way to  
> do it and also make it more flexible so down the road if more sections get  
> added I would not have to go add another table for that data.Â I put the  
> header info(job role/requirements) into the DB so I could change it through  
> the form instead of having to go into the code to modify it.Â Right now  
> there are 5 of those sections in the form so I just do a FIND on them and  
> loop through how many times they are there and display a partial X times and  
> use the data in the db for the header info to make it relatively dynamic.

Sorry, you have completely lost me, please describe your table setup  
more clearly. Give the name of each table and what the columns are  
(not necessarily all the columns but enough for me to understand)  
What do you mean ‘the 5 pieces that repeat’? Again please describe  
the data more clearly, not just in words but with field names and  
descriptions.

Colin

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [September 6, 2009, 7:00pm UTC](https://www.ruby-forum.com/t/personnel-evaluation-modeling-question/174981/6 "2009-09-06T19:00:22Z")

</div>

Ok, I was referring to my first post, this data:

Key Job Responsibility #1 job1  
Desired Outcome(s) outcome 1

Employee Assessment  
Self Assessment Rating:  
Self Assessment Comments:

Supervisor Assessment  
Supervisor Rating:  
Supervisor Comments:

repeats itself 5 times in the form. I was thinking instead of making 5  
tables to hold the data ther mught be a more efficient way and flexible  
way  
to hold the data. I do not have any tables yet really I was waiting to  
see  
if a better way to do it than to statically make 5 tables if there was a  
different way to do this section of the form.

The Key job resp, and outcomes TEXT are static, that is in the db.  
Example,

job responsibility, _understand the network(in the db)._  
outcomes, _know all systems_(in the db).

Therefore I have 5 rows in a table that hold that data. I loop through  
and  
display the data section above in a table format with the the text from  
the  
db populating the responsibility and outcomes section and then a drop  
down  
box for the rating and a text area for comments.

Right now I have no tables to insert for the data.

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [September 6, 2009, 7:12pm UTC](https://www.ruby-forum.com/t/personnel-evaluation-modeling-question/174981/7 "2009-09-06T19:12:06Z")

</div>

OH, ok. that makes a bit more sense. I was trying to do each section  
as a  
whole separate entity. doh.

---

<div class="post-metadata">

**Author:** ![bigdaddy71](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/bbe5ce/32.png) [@bigdaddy71](https://www.ruby-forum.com/u/bigdaddy71)\
**Post date:** [September 6, 2009, 7:06pm UTC](https://www.ruby-forum.com/t/personnel-evaluation-modeling-question/174981/8 "2009-09-06T19:06:50Z")

</div>

2009/9/6 Chris H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Supervisor Assessment  
> Supervisor Rating:  
> Supervisor Comments:
> 
> repeats itself 5 times in the form.Â I was thinking instead of making 5  
> tables to hold the data ther mught be a more efficient way and flexible way  
> to hold the data.Â I do not have any tables yet really I was waiting to see  
> if a better way to do it than to statically make 5 tables if there was a  
> different way to do this section of the form.

Why do you contemplate 5 tables? Why not just have 5 rows in one  
table? I think we are back to what I was saying originally, think  
about the data you are trying to model. What do you call one set of  
the data above? Maybe a Responsibility? So have a responsibilities  
table. Then what is it that has these responsibilities? An Employee?  
So have an employees table. Then

Employee has\_many :responsibilities # it will be 5 actually  
Responsibility belongs\_to :employee

If you have an employee in @employee then his responsibilities are  
@employee.responsibilities.

Colin
