• Yorick Peterse's avatar
    Reduce queries in GroupProjectsFinder · 77d4546e
    Yorick Peterse authored
    GroupProjectsFinder#collection_with_user would run the following code:
    
        if group.users.include?(current_user)
    
    When running this code for multiple groups this would result in one
    query being executed for every group.
    
    This commit simple removes the entire "if" statement with the code of
    the "else" statement. This ensures both paths use the same code, and
    removes the need for explicitly checking if a user is a member of the
    group.
    77d4546e
group_projects_finder.rb 2.08 KB