Set the reported_user in a callback
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 12 Jul 2017 12:36:48 +0000 (13:36 +0100)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 12 Jul 2017 12:36:48 +0000 (13:36 +0100)
commit506c0b5f0db8aca79ef61fa45cad508b7167817a
tree8afdac584b0e8244e3cad73785bfb53d2f2c951e
parent65e1dbb4a69cf5251c638e50e480aee3b77bca50
Set the reported_user in a callback

This avoids passing around the reported_user via forms. There was no
validation anywhere that the reported_user corresponded to the object
being reported. This approach removes those worries too.
app/controllers/issues_controller.rb
app/models/issue.rb
app/views/browse/changeset.html.erb
app/views/browse/note.html.erb
app/views/diary_entry/_diary_comment.html.erb
app/views/diary_entry/_diary_entry.html.erb
app/views/issues/new.html.erb
app/views/user/view.html.erb
test/models/issue_test.rb