diff options
-rw-r--r-- | perllib/FixMyStreet/DB/Result/User.pm | 2 | ||||
-rw-r--r-- | t/app/model/user_planned_report.t | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/DB/Result/User.pm b/perllib/FixMyStreet/DB/Result/User.pm index 8d42d5926..7aa7a3272 100644 --- a/perllib/FixMyStreet/DB/Result/User.pm +++ b/perllib/FixMyStreet/DB/Result/User.pm @@ -355,7 +355,7 @@ sub adopt { around add_to_planned_reports => sub { my ( $orig, $self ) = ( shift, shift ); my ( $report_col ) = @_; - my $existing = $self->user_planned_reports->search_rs({ report_id => $report_col->{id}, removed => undef })->first; + my $existing = $self->user_planned_reports->search_rs({ report_id => $report_col->id, removed => undef })->first; return $existing if $existing; return $self->$orig(@_); }; diff --git a/t/app/model/user_planned_report.t b/t/app/model/user_planned_report.t index 6c0823044..a9c2ee9b5 100644 --- a/t/app/model/user_planned_report.t +++ b/t/app/model/user_planned_report.t @@ -19,6 +19,10 @@ $user->add_to_planned_reports($problem); is $user->active_planned_reports, 1; is $user->planned_reports, 1; +$user->add_to_planned_reports($problem); +is $user->active_planned_reports, 1; +is $user->planned_reports, 1; + $user->remove_from_planned_reports($problem); is $user->active_planned_reports, 0; is $user->planned_reports, 1; |