[Catalyst] strange generated DBIC accessor name
Ben van Staveren
benvanstaveren at gmail.com
Wed Mar 10 19:01:32 GMT 2010
DBIx::Class tends to pluralize relationships, so if you have a one to
many relationship with a table "company_person", it will name it
"company_people". Generally speaking this is also predictable :)
th at dix.cz wrote:
>
> Hello catal[yi]sters,
>
> I'm going to be crazzy about one generated accessor name:
>
> __PACKAGE__->has_many(
> "company_people", # I expected to be "company_persons"
> "Jf::Schema::Result::CompanyPerson",
> { "foreign.role" => "self.id" },
> );
>
> Other names seems to be predictable:
>
> __PACKAGE__->has_many(
> "company_addresses",
> "Jf::Schema::Result::CompanyAddress",
> { "foreign.role" => "self.id" },
> );
>
>
> I have no "people" pattern in my database. Did I miss something?
>
> The schema has been generated as usual:
>
> script/jf_create.pl model DB DBIC::Schema Jf::Schema create=static \
> 'dbi:Pg:dbname=jf' tomas
>
> Thanx,
> Tomas
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
--
Ben van Staveren
phone: +62 81 70777529
email: benvanstaveren at gmail.com
More information about the Catalyst
mailing list