diff options
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( |