View | Details | Raw Unified | Return to bug 29495
Collapse All | Expand All

(-)a/Koha/Schema/Result/ReturnClaim.pm (-7 / +18 lines)
Lines 282-297 __PACKAGE__->belongs_to( Link Here
282
282
283
=head2 checkout
283
=head2 checkout
284
284
285
Type: belongs_to
285
Type: has_many but should be belongs_to
286
287
To get around TestBuilder failures we set this relation to has_many as it
288
allows us to produce the same query without triggering TestBuilder failures
289
(when it tries to create the issue twice, once for the checkout and once for
290
the old_checkouts relation below). might_have would also be more appropriate,
291
but this triggers a DBIC warning as the key field here is nullable.
286
292
287
Related object: L<Koha::Schema::Result::Issue>
293
Related object: L<Koha::Schema::Result::Issue>
288
294
289
=cut
295
=cut
290
296
291
__PACKAGE__->belongs_to(
297
__PACKAGE__->has_many(
292
    "checkout",
298
    "checkout",
293
    "Koha::Schema::Result::Issue",
299
    "Koha::Schema::Result::Issue",
294
    { issue_id => "issue_id" },
300
    { "foreign.issue_id" => "self.issue_id" },
295
    {
301
    {
296
        is_deferrable => 1,
302
        is_deferrable => 1,
297
        join_type     => "LEFT",
303
        join_type     => "LEFT",
Lines 300-315 __PACKAGE__->belongs_to( Link Here
300
306
301
=head2 old_checkout
307
=head2 old_checkout
302
308
303
Type: belongs_to
309
Type: has_many but should be belongs_to
310
311
To get around TestBuilder failures we set this relation to has_many as it
312
allows us to produce the same query without triggering TestBuilder failures
313
(when it tries to create the issue twice, once for the checkout relation above
314
and once for the old_checkouts). might_have would also be more appropriate,
315
but this triggers a DBIC warning as the key field here is nullable.
304
316
305
Related object: L<Koha::Schema::Result::OldIssue>
317
Related object: L<Koha::Schema::Result::OldIssue>
306
318
307
=cut
319
=cut
308
320
309
__PACKAGE__->belongs_to(
321
__PACKAGE__->has_many(
310
    "old_checkout",
322
    "old_checkout",
311
    "Koha::Schema::Result::OldIssue",
323
    "Koha::Schema::Result::OldIssue",
312
    { issue_id => "issue_id" },
324
    { "foreign.issue_id" => "self.issue_id" },
313
    {
325
    {
314
        is_deferrable => 1,
326
        is_deferrable => 1,
315
        join_type     => "LEFT",
327
        join_type     => "LEFT",
316
- 

Return to bug 29495