aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB/ResultSet/Problem.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2011-09-06 15:27:42 +0100
committerMatthew Somerville <matthew@mysociety.org>2011-09-06 15:27:42 +0100
commit114bbb73861ab38972a92b970547c46457cdcc33 (patch)
tree887b3317cc28e85e42e74def531e95fb45e13f96 /perllib/FixMyStreet/DB/ResultSet/Problem.pm
parent7fc1083eb431312a59758c473e8ff52ceb8585ef (diff)
Show datetimes on front page, fewer headings.
Diffstat (limited to 'perllib/FixMyStreet/DB/ResultSet/Problem.pm')
-rw-r--r--perllib/FixMyStreet/DB/ResultSet/Problem.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/DB/ResultSet/Problem.pm b/perllib/FixMyStreet/DB/ResultSet/Problem.pm
index 8c1f95bae..44c066454 100644
--- a/perllib/FixMyStreet/DB/ResultSet/Problem.pm
+++ b/perllib/FixMyStreet/DB/ResultSet/Problem.pm
@@ -64,11 +64,14 @@ sub recent {
my ( $rs ) = @_;
my $key = "recent:$site_key";
my $result = Memcached::get($key);
- unless ($result) {
+ if ( $result ) {
+ # Need to reattach schema so that confirmed column gets reinflated.
+ $result->[0]->result_source->schema( $rs->result_source->schema );
+ } else {
$result = [ $rs->search( {
state => [ FixMyStreet::DB::Result::Problem->visible_states() ]
}, {
- columns => [ 'id', 'title' ],
+ columns => [ 'id', 'title', 'confirmed' ],
order_by => { -desc => 'confirmed' },
rows => 5,
} )->all ];