On 19 Jan 2011, at 15:33, Leandro Hermida wrote:

>  1. Delete the bridging relationship
>        $person->person2address->delete;
> 
> I tried this but get Can't locate object method "person2address" via package 
> "MySchema::Result::Person"? What did I set up wrong?  In 
> MySchema::Result::Person I have for the relationship:

What version of DBIx::Class are you using?

Whats happening here is $person->person2address is returning (a list of)
row objects.  I thought that this happened in array mode with scalar
mode returning the RS for the query.

In any case, if you want a RS, you can always use the _rs accessor,
so 
        $person->person2address_rs->delete;

will work without any ambiguity (and works in Template Toolkit if
you are playing with objects within templates where the inherent
array mode tends to break stuff).

        Nigel.
--
[ Nigel Metheringham             [email protected] ]
[ - Comments in this message are my own and not ITO opinion/policy - ]





_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]

Reply via email to