`Repository#last_completed_build` only queries completed builds. Denormalization happens when a build starts as well, at which point I think this wouldn't work very well. I think a new method has to be created in `Repository`. I would also like to see the call to `repository.default_branch` being pushed into `Repository`. Right now there is much more code in this method that has to do with repositories instead of builds, which to me is an indicator that the code probably belongs there instead of here.

Ideally, I'd like to see this method read something like this:

``` Ruby
def last_build_on_default_branch?
    repository.last_build_on_default_branch == self
end
```

Feel free to change the naming around, this is just a draft/suggestion of what it may look like.

Do you think this sounds sensible?