Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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 drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2020-02-26 04:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (113 votes). Check out past polls.

    Notices?