I have a contact, and contact has_many :phones. The phones table has a column named, phones_desc, where I want to include the type of phone number the user has saved.
My question / Best practice
Should I provide a select with manually provided options (such as "mobile", "work", "home")...
-or-
...create a new model named phones_types where I can add the values I'd like, thus creating a unique ID for each one. Then I can do the following after changing phone_desc to phone_type_id, adding phones has_many :phone_types and giving the phone_types table a name column:
@phone = Phone.first
@phone.type.name
Sidenote
I'm currently doing it with the first option (not a separate model) and am having trouble with it selecting the value when I go to edit the parent object. In other words, the select options don't have the saved value selected when going to edit phone numbers.
It always has the first option selected, so the user may inadvertently change the phone_desc without realizing it.
If the first option is in fact the better way to go, would you have any insight on how to get the objects value to be the selected value when editing phones descriptions via a select?