database - Rails preference tables and over-riding -
i'm wondering best way go following design problem:
i have user have preferences table. have venue, belongs user. want following functionality:
a venue have preferences, of set in preference table belonging user. want these "default" preferences. however, each individual venue can override these preferences.
single table inheritance? separate models , check existence of "venue preferences?"
assuming user's default preferences , user's specific venue preferences have same exact attributes, seems candidate single table inheritance. so, preferences have both user id venue id. then, in order determine actual preferences venue be, you'd first check see if there preferences venue. otherwise, default user's preferences.
Comments
Post a Comment