This is with ActiveAdmin 0.4.3. Our app runs polls, which can have any number of SurveyQuestions. When a user fills out a survey, an instance of UserSurveyComment is created, which has_many SurveyComments, one for each Survey SurveyQuestions survey.
As a result of this, for any given survey, all instances of UserSurveyComment will have the same number of SurveyComments, but this number may vary between polls.
Is it possible to export ActiveSQL CSV to process UserSurveyComments so that in turn there are columns for the user, the survey, and then each survey? Export is covered by the Overview, so each row has the same columns, but a particular export may have a different number.
What I would like to do is something like
survey.survey_questions.each do |sq| column "Question" { |q| q.survey_comments.where(survey_question_id: sq.id).first.submitted_text } end
... but in the instance of ActiveAdmin.CSVBuilder, there seems to be no way to get to the Overview.
Maybe itβs just easier for me to do this in my own controller?
source share