The conditionals could be simplified by:
```
repo = where(github_id: attributes[:github_id]).first_or_initialize
repo.update_attributes(attributes)
repo
```