This is really a matter for the DBIx::Class mailing list But I'm still not clear why I need to use the belongs_to relationship when > the affiliation_id is directly available in the People table.
If you only want to access the affiliation_id column then no, you wouldn't need to define the belongs_to relationship. However it seems the belongs_to relationship was declared with the same name as the "affiliation_id" column, so rather than the accessor returning the column value that you expected, you got the belongs_to relationship (which happens to have it's own "affiliation_id" column accessor). Have a look at the docs for declaring the belongs_to() relationship and take note of the difference between the relationship name (e.g. "affiliation") and the name of the foreign key used to define the relationship (e.g. "affiliation_id"). http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class/Relationship.pm#belongs_to Also maybe take a closer look at the usage examples in my last post - that should really explain the same as above. Cheers, -- Ian Sillitoe CATH Team -- http://cathdb.info
_______________________________________________ List: [email protected] Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/
