Lp
2009-Mar-05 14:15 UTC
Global Hash vs. DB-Model (...social-networking-site with profile -> eyecolour e.g.) - best practise
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! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Tim
2009-Mar-05 15:30 UTC
Re: Global Hash vs. DB-Model (...social-networking-site with profile -> eyecolour e.g.) - best practise
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. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---