In my application I have a model question
which contains a defined set of survey questions (survey
has_many question
s). These questions are offered as a defined set by us as owners of the application, but customers are free to either use this defined set or customize the set to their own liking by modifying, removing or adding questions to the defined set. The issue I have is how to model this.
Option 1: create a many_to_many relation between customer
and question
to store the customized questions when needed. This works for modifying existing questions, but how about new questions or removed questions?
Option 2: create a one-to-many relation between customer
and customerquestion
and copy the whole set of defined questions into customerquestion
when a new customer
is created. This will create a lot of duplicate records when the customer hardly makes changes. Also what about synchronisation between the default set and the customer set when there is a change in the default set?
What would be the best option, how should I model this? And am I missing a better solution for this situation?