This should be done in link.rb. For the sake of modularity, only the link should be concerned with how it updates it's score. It's child comments will tell it when it should update it, but the link should be the one actually doing it. Also, the upvote and downvote methods should be in here.