[Dbix-class] Weird behaviour in 0.07999_02
Jonas B. Nielsen
jonasbn at gmail.com
Thu Apr 19 10:28:03 GMT 2007
Hello,
I am currently working on a solution, which is based on Catalyst and
Handel. The lastest developments in Handel (0.99_15), requires
bleeding-edge DBIx::Class.
I have up to now used: DBIx::Class 0.07999_01, but my colleague who
set up a new environment installed: DBIx::Class 0.07999_02.
This resulted in a weird issue, which was however easily resolved.
We have a setup where our namespace is layed out in the following way:
FAIadmin/DB.pm
FAIadmin/DB/*.pm
FAIadmin/RS/*.pm
Now when we execute any of our tests related to the DB::* classes,
which define a resultset class explicitly like so:
package FAIadmin::DB::Customers;
__PACKAGE__->resultset_class('FAIadmin::RS::Customers');
It breaks with the following error message:
Can't locate object method "new" via package
"FAIadmin::RS::Customers" (perhaps you forgot to load
"FAIadmin::RS::Customers"?) at /Library/Perl/5.8.6/DBIx/Class/
ResultSource.pm line 971.
The fix is simple:
use FAIadmin::RS::Customers;
in FAIadmin::DB::Customers
What troubles me however is that this just used to work and the
change has major impact on stuff we are doing and behaviour in
DBIx::Class.
Is this a known issue? it has some sideeffect feeling to it, or
perhaps it is just me. I am fully aware of the dangers of running on
bleeding-edge development code, but sometimes this is that path one
must follow :)
Another question, which arose with the issue above was, what is the
recommended layout of a namespace? as the one I use above or should
RS go under DB the following way:
FAIadmin/DB.pm
FAIadmin/DB/*.pm
FAIadmin/DB/RS/*.pm
Or is this totally irrelevant, the reason why I ask, was sparked by
some of the first feedback I got when inquiring about the above issue
on IRC.
jonasbn
More information about the Dbix-class
mailing list