[Dbix-class] missing 'many-to-many' relationship

fREW Schmidt frioux at gmail.com
Wed Aug 4 14:46:52 GMT 2010


On Wed, Aug 4, 2010 at 7:34 AM, Steve <steve at matsch.com> wrote:

> Hi all,
>
>>  I am bewildered as to why my 'many_to_many' relationship is being
>>> ignored.
>>> I get an error when trying to use the relationship because it 'does not
>>> exist',
>>> and clearly it doesn't.  WHY?
>>> My result classes are 'User.pm', 'Role.pm', and 'UserRole.pm'.
>>> I'm using the DBIC::Loader to generate the 'has_many', and 'belongs_to'
>>> relationships, which leaves me to create the 'many_to_many' relationship
>>> manually.
>>> ...
>>>
>>>
>>
>   include the error message please.
>>
>>  From memory: No such relationship roles in DCO::Schema::Result::User


So to be clear, you are saying that you added the roles many to many in user
and you do $user->roles and get that error?

I'm guessing you did something like $user->related_resultset('roles'), which
wouldn't work since technically m2m isn't a relationship.

I can't really say more though without seeing actual code and actual errors.


-- =

fREW Schmidt
http://blog.afoolishmanifesto.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20100804/7fe=
a2bb1/attachment-0001.htm


More information about the DBIx-Class mailing list