I'm building a survey app and trying to build a duplication feature so users can duplicate surveys.
What I need to do is duplicate the survey, that survey's questions and each questions answers (multiple choice options, for instance).
Here are my associations:
#Survey
has_many :questions
#Question
belongs_to :survey
has_many :answers
#Answer
belongs_to :question
So, how can I duplicate/clone a survey as well as its associations?
I'm running Rails 3.