On Tue, Aug 3, 2010 at 8:04 AM, Steve <[email protected]> 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.
>
> The User.pm result class relationships:
> (generated by loader)
> __PACKAGE__->has_many("user_roles", "DCO::Schema::Result::UserRole",
>   { "foreign.users_id" => "self.id" });
>
> (written by me)
> __PACKAGE__->many_to_many('roles', 'user_roles', 'role');
>
> I set a breakpoint for the debugger just prior to the 1; at the end of the
> package
> and interrogated the schema. I clearly see that the 'user_roles'
> relationship exists,
> but the 'roles' relationship does not.  No syntax errors, all other
> relationships
> are being used successfully in the schema.
>
> Any clue as to why this relationship is not created?
>
> Thanks as always,
> Steve


 include the error message please.
-- 
fREW Schmidt
http://blog.afoolishmanifesto.com
_______________________________________________
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