title: Ruby on Rails - Counting goals of a team in many matches
body: <p>I've got a <strong>Match</strong> model and a <strong>Team</strong> model.</p>
  
  <p>I want to count how many goals a Team scores during the league (so I have to sum all the scores of that team, in both <strong>home_matches</strong> and <strong>away_matches</strong>).</p>
  
  <p>How can I do that? What columns should I put into the <strong>matches</strong> and <strong>teams</strong> database tables?</p>