From 1759b9f5d8dfbe8bad7d5532988feb71ef0d9b11 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 18 Jul 2013 06:49:14 -0400 Subject: [PATCH] Bug 10565 - Add a "Patron List" feature for storing and manipulating collections of patrons - Followup - Fix DBIx::Class error Fixes this error: DBIx::Class::Relationship::HasOne::might_have(): "might_have/has_one" must not be on columns with is_nullable set to true (Koha::Schema::Result::Borrower/cardnumber). This might indicate an incorrect use of those relationship helpers instead of belongs_to. --- Koha/Schema/Result/Borrower.pm | 41 +++++++++++++++++++++++++++------------ 1 files changed, 28 insertions(+), 13 deletions(-) diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm index 2b700bf..819901b 100644 --- a/Koha/Schema/Result/Borrower.pm +++ b/Koha/Schema/Result/Borrower.pm @@ -769,33 +769,48 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); -=head2 patroncards +=head2 patron_list_patrons Type: has_many -Related object: L +Related object: L =cut __PACKAGE__->has_many( - "patroncards", - "Koha::Schema::Result::Patroncard", + "patron_list_patrons", + "Koha::Schema::Result::PatronListPatron", { "foreign.borrowernumber" => "self.borrowernumber" }, { cascade_copy => 0, cascade_delete => 0 }, ); -=head2 patronimage +=head2 patron_lists + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "patron_lists", + "Koha::Schema::Result::PatronList", + { "foreign.owner" => "self.borrowernumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 patroncards -Type: might_have +Type: has_many -Related object: L +Related object: L =cut -__PACKAGE__->might_have( - "patronimage", - "Koha::Schema::Result::Patronimage", - { "foreign.cardnumber" => "self.cardnumber" }, +__PACKAGE__->has_many( + "patroncards", + "Koha::Schema::Result::Patroncard", + { "foreign.borrowernumber" => "self.borrowernumber" }, { cascade_copy => 0, cascade_delete => 0 }, ); @@ -950,8 +965,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07000 @ 2013-06-18 13:13:57 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RZG8l5yFKXZzsAY8CenNeA +# Created by DBIx::Class::Schema::Loader v0.07000 @ 2013-07-18 06:47:46 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MGnxqHPAA123Qg8wdBnXAw # You can replace this text with custom content, and it will be preserved on regeneration -- 1.7.2.5