aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB/ResultSet/Problem.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-09-07 09:49:10 +0100
committerStruan Donald <struan@exo.org.uk>2011-09-07 09:49:10 +0100
commit82b093ae5b2f313c1393efb2b26e12563c2aaa5f (patch)
treefde92abd3d37d7f03dda3c6d69df07d26c8b06b3 /perllib/FixMyStreet/DB/ResultSet/Problem.pm
parentb71f5857ecf50a78e13fe521986f49e304f0a7bf (diff)
parent4cdc50037c8abb27744d672a2ad496bb27086652 (diff)
Merge branch 'master' of ssh://git.mysociety.org/data/git/public/fixmystreet into js-validation
Conflicts: templates/web/default/common_header_tags.html
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 ];