I have a general question about whether people think you should use a database table or constants hashes/arrays for categories. I’m torn on which way to go. Thoughts?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Well, if you are 100% sure you won’t ever change the categories, you could go for a custom model with the Object superclass (no DB-table and no ActiveRecord).
If you ever would change a category or add any you want a database. This is because your models won’t get reloaded after a change in production mode.
I still recommend a database anyway because of at least the following: