Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: DBI::Class relationship naming

by shmem (Chancellor)
on Dec 31, 2016 at 16:02 UTC ( #1178740=note: print w/replies, xml ) Need Help??

in reply to DBI::Class relationship naming

Is this exactly the code you are running? If so, you probably are missing a 's'

my $t1_rs = $schema->resultset('T1'); $query_rs = $t1_rs->search; while (my $account = $query_rs->next) { print Dumper $account->groupname->name; } # here ---^

since in your table t1 the column is named "groupnames", not "groupname".

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

Replies are listed 'Best First'.
Re^2: DBI::Class relationship naming
by Beatnik (Parson) on Jan 01, 2017 at 08:06 UTC
    Actually, that was exactly my point. The code is running fine despite the fact that the field is not called the same. The relationship mapping is renaming the field/method.

    ... I'm belgian but I don't play one on TV.
      Can you replicate the problem, if you use names that are more dissimilar, e.g. foogroup and bargroup? Perhaps there is some strncmp involved somewhere (or some other "groupname" …)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1178740]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2021-05-09 11:27 GMT
Find Nodes?
    Voting Booth?
    Perl 7 will be out ...

    Results (100 votes). Check out past polls.