Use Repository class in Application#closed_pull_requests
Refactor how PullRequest objects are created and added to database