lib/modules/pivot_tables.rb
def matrix_answer_answers_rel(questions_rel)
      MatrixAnswer.
        from('pt_matrix_answer_answers_by_user_view matrix_answers').joins(
          'JOIN (' + questions_rel.to_sql + ') questions' +
          " ON matrix_answers.question_id = questions.id AND questions.answer_type_type = 'MatrixAnswer'"
        )
    end
# Filters out only matrix questions from Section 3.
Filters out only matrix questions from Section 3.
Filters out only matrix questions from Section 3 .
def matrix_answer_answers_rel(questions_rel)
      MatrixAnswer.
        from('pt_matrix_answer_answers_by_user_view matrix_answers').joins(
          'JOIN (' + questions_rel.to_sql + ') questions' +
          " ON matrix_answers.question_id = questions.id AND questions.answer_type_type = 'MatrixAnswer'"
        )
    end
def matrix_answer_answers_rel ( questions_rel ) MatrixAnswer . from ( 'pt_matrix_answer_answers_by_user_view matrix_answers' ) . joins ( 'JOIN (' + questions_rel . to_sql + ') questions' + " ON matrix_answers.question_id = questions.id AND questions.answer_type_type = 'MatrixAnswer'" ) end
Filters out only matrix questions from Section 3.
Filters out only matrix questions from Section 3 .
questions_rel