• Jan Provaznik's avatar
    Use 'preload' in export to CSV · 020701fa
    Jan Provaznik authored
    If issues are filtered by multiple labels, then GROUP BY statement
    is used to filter only issues with these labels. This is problem in
    combination with '.includes' which may use JOIN statement to load
    associated resources in single query instead of a separate query.
    
    Then the generated SQL query fails because associated resources
    are included in 'SELECT ...' statements but not in the GROUP BY
    statement.
    
    Usage of '.preload' instead of '.includes' ensures that Active Record
    uses a separate query instead of JOIN.
    
    Closes #4376
    020701fa
3841-fix-export-to-csv.yml 105 Bytes