Forum: Ruby on Rails Global Hash vs. DB-Model ( with profile -> eyecolour e.g.) - best practise

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Lp (Guest)
on 2009-03-05 16:15
(Received via mailing list)

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?

sorry for my bad english!
Tim (Guest)
on 2009-03-05 19:32
(Received via mailing list)
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

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.
This topic is locked and can not be replied to.