Im trying to eliminate two tables from my database. The tables are message_sort_options and per_page_options. These tables basically just have 5 records which are options a user can set as their preference in a preferences table. The preferences table has columns like sort_preferences and per_page_preference which both point to a record in the other two tables containing the options. How can i set up the models with virtual attributes and fixed values for the options – eliminating table lookups every time the preferences are looked up?
Im trying to eliminate two tables from my database. The tables are message_sort_options and
Share
Create a
app_config.ymlfile inconfigdirectory.Create
UserOptionsclass in models directory.Configure your models:
Now you can do the following: