Make Repository#log_changes_with_user not eat validation errors
authorJohan Sørensen <johan@johansorensen.com>
Tue, 15 Sep 2009 09:03:04 +0000 (11:03 +0200)
committerJohan Sørensen <johan@johansorensen.com>
Tue, 15 Sep 2009 09:03:04 +0000 (11:03 +0200)
commit27bb1b4efa6e8f494cdfa8631ad7299cc13c10a5
tree0103dc2bb061238a31b7b66f5ea90bb665a02fc0
parenta0d8917259a20738f978920c509409b9f3afbc2c
Make Repository#log_changes_with_user not eat validation errors

By reverting to the old value on a validation error, the message fails
to bubble up to the UI. Also, use the accessors instead of
write_attribute. Furthermore, also reload the @repository object for
the form action target, otherwise it could redirect to the previously
invalid slug.
app/controllers/repositories_controller.rb
app/models/repository.rb
app/views/repositories/edit.html.erb