Skip Menu |

This queue is for tickets about the DBIx-Class-Schema-Loader CPAN distribution.

Report information
The Basics
Id: 119677
Status: rejected
Priority: 0/
Queue: DBIx-Class-Schema-Loader

People
Owner: Nobody in particular
Requestors: hendrik.vanbelleghem [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: dbicdump - belongs_to generation for table relationships
Date: Tue, 3 Jan 2017 22:23:40 +0100
To: bug-DBIx-Class-Schema-Loader [...] rt.cpan.org
From: Hendrik Van Belleghem <hendrik.vanbelleghem [...] gmail.com>
The modules generated by dbicdump, based on table relationships have a mapping without 's'. That seems to be explicitly discarded. See enclosed skeleton code. __PACKAGE__->belongs_to( "fieldwith", "DBIC::Schema::Result::R1", { id => "fieldwiths" }, { is_deferrable => 0, join_type => "LEFT", on_delete => "NO ACTION", on_update => "NO ACTION", }, ); The original field name obviously DOES have an s at the end. Hendrik Van Belleghem

Message body is not shown because sender requested not to inline it.

On 2017-01-03 21:23:58, BEATNIK wrote: Show quoted text
> The modules generated by dbicdump, based on table relationships have a > mapping without 's'. That seems to be explicitly discarded. See enclosed > skeleton code.
The default behaviour is to singularise belongs_to relationship names, since they return a single related object. To override this you can provide a custom 'inflect_singular' hash or code ref: https://metacpan.org/pod/DBIx::Class::Schema::Loader::Base#inflect_singular Show quoted text
> __PACKAGE__->belongs_to( > "fieldwith", > "DBIC::Schema::Result::R1", > { id => "fieldwiths" }, > { > is_deferrable => 0, > join_type => "LEFT", > on_delete => "NO ACTION", > on_update => "NO ACTION", > }, > ); > > The original field name obviously DOES have an s at the end. > Hendrik Van Belleghem