Avoid a validation error in Repository#destroy
authorMarius Mathiesen <marius@gitorious.org>
Wed, 26 Sep 2012 11:19:33 +0000 (13:19 +0200)
committerMarius Mathiesen <marius@gitorious.org>
Mon, 8 Oct 2012 07:41:36 +0000 (09:41 +0200)
commit89e0d00c110b4a048a30edb635cb97463dbb2382
treecc114b3004ef60bf7abde609d29a103a6eb2a1cd
parent7d1627a329c6113ea76c3246c5a7acada673f147
Avoid a validation error in Repository#destroy

ActiveRecord would throw a validation error when creating(!) the
tracking repository for a repository while sending branch deletion
notifications from merge request versions while removing a repository.

Ensuring that all merge requests are removed before removing a
repository and reloading the repository resolves this error, and makes
it possible to destroy repositories.

This commit would be considered pragmatic.
app/models/repository.rb
test/unit/repository_test.rb