diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-11-22 22:06:53 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-11-26 12:49:23 +0000 |
commit | c69891dffcb3810ebb951af4a563c556b2deeb0d (patch) | |
tree | 3ba5a477e0f5d92062c94c032c2f9c9a4feb3e86 /perllib/FixMyStreet/DB/Result/Comment.pm | |
parent | eb2aba46eabc8d90656b760cf4900f56119de9ca (diff) |
Show moderation history in report/update admin.
Diffstat (limited to 'perllib/FixMyStreet/DB/Result/Comment.pm')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Comment.pm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm index d3551956f..3a2b7d84b 100644 --- a/perllib/FixMyStreet/DB/Result/Comment.pm +++ b/perllib/FixMyStreet/DB/Result/Comment.pm @@ -197,6 +197,13 @@ __PACKAGE__->has_many( } ); +sub moderation_history { + my $self = shift; + return $self->moderation_original_datas->search({ + problem_id => $self->problem_id, + }, { order_by => { -desc => 'id' } })->all; +} + # This will return the oldest moderation_original_data, if any. # The plural can be used to return all entries. __PACKAGE__->might_have( |