Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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.


    Greetz
    Beatnik
    ... 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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2019-08-26 09:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?