N+1 fix on ArticlesCourses
N+1 fix on ArticlesCourses

 N+1 fix: only look up revisions once when updating ArticleCourses cache

    Prior to this commit, 4 queries would be triggered.

    Since revisions.sum(&:references_added) necessarily loads all revisions, there is no need to go back to the database for things like sums of characters, checking for existence of revisions, or earliest revision date.

WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard