* Koha/Patron/HouseboundVisit.pm (chooser, deliverer): Use
`_new_from_dbic` to return Koha::Patron objects.
* t/db_dependent/Patron/HouseboundVisits.t: Remove TODO section for this.
Signed-off-by: Claire Gravely <claire_gravely@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
use Modern::Perl;
use Koha::Database;
+use Koha::Patron;
use base qw(Koha::Object);
sub chooser {
my ( $self ) = @_;
- return $self->_result->chooser_brwnumber;
+ my $rs = $self->_result->chooser_brwnumber;
+ return Koha::Patron->_new_from_dbic( $rs );
}
=head3 deliverer
sub deliverer {
my ( $self ) = @_;
- return $self->_result->deliverer_brwnumber;
+ my $rs = $self->_result->deliverer_brwnumber;
+ return Koha::Patron->_new_from_dbic( $rs );
}
is( $result->chooser->borrowernumber, $visit->{chooser_brwnumber} );
-TODO: {
- local $TODO = "We want our results here to be Koha::Patron objects, but they by default return DBIC Schema objects. The currently accepted solution to this (use the _from_dbic method), is defined for Koha::Objects, but not for Koha::Object. We do not resolve this issue here";
- isa_ok( $result->deliverer, "Koha::Patron");
- isa_ok( $result->chooser, "Koha::Patron");
-}
+isa_ok( $result->deliverer, "Koha::Patron");
+isa_ok( $result->chooser, "Koha::Patron");
$schema->storage->txn_rollback;