# Global Hash vs. DB-Model (...social-networking-site with profile -\> eyecolour e.g.) - best practise

**URL:** <https://www.ruby-forum.com/t/global-hash-vs-db-model-social-networking-site-with-profile-eyecolour-e-g-best-practise/162077>\
**Category:** Rails\
**Created:** [March 5, 2009, 3:15pm UTC](https://www.ruby-forum.com/t/global-hash-vs-db-model-social-networking-site-with-profile-eyecolour-e-g-best-practise/162077 "2009-03-05T15:15:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LpLpLp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/bc8723/32.png) [@LpLpLp](https://www.ruby-forum.com/u/LpLpLp)\
**Post date:** [March 5, 2009, 3:15pm UTC](https://www.ruby-forum.com/t/global-hash-vs-db-model-social-networking-site-with-profile-eyecolour-e-g-best-practise/162077/1 "2009-03-05T15:15:53Z")

</div>

Hello,

can somebody tell me what to do with static-models? Should I put them  
into the DB or should I create it als normal Hash?

For example:  
User has one eyecolour and he is able to choose the right value in a  
view (select-box).

Should I create the select-box from an global hash or from an AR-  
Model? Is there a best practise?

Thanks,  
sorry for my bad english!

---

<div class="post-metadata">

**Author:** ![LpLpLp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/bc8723/32.png) [@LpLpLp](https://www.ruby-forum.com/u/LpLpLp)\
**Post date:** [March 5, 2009, 6:32pm UTC](https://www.ruby-forum.com/t/global-hash-vs-db-model-social-networking-site-with-profile-eyecolour-e-g-best-practise/162077/2 "2009-03-05T18:32:01Z")

</div>

If it’s a list of items that will never/rarely change (gender is a  
good example), it makes sense to put it in a Hash to avoid hitting the  
database.

If it’s something that would change frequently, it probably makes more  
sense to create it as a Model and have it database driven.

A list of eye colors is probably something that won’t ever change, so  
I’d personally make it a Hash.
