[Dbix-class] ping 'from' attribute doc author: you need to fix them
Matt S Trout
dbix-class at trout.me.uk
Wed May 10 17:55:12 CEST 2006
Toby Corkindale wrote:
> just following on from a discussion on IRC yesterday..
> I was asking about why a 'from' clause in a search method of mine was causing
> D::C to die with an error.*
> The answer given was that I shouldn't be using 'from' at all, as I wasn't a
> developer, and only people who were willing to read and grok the source code
> should touch that attribute.
That was largely because I was grumpy and had already said "you don't
need this, you should be using 'join' which will work fine" three times
and been ignored.
Fortunately, "either read the entire source for half of DBIC or stop
asking questions about from" got you to read the docs and figure out how
to do it properly before I got *really* mad :)
Sometimes the answer I give is a solution to a meatware problem, not a
software problem :)
> However, there is actually quite a lot of documentation for 'from' in the
> manual (see perldoc DBIx::Class::ResultSet). (To mst's surprise :)
> I believe that if you're going to put docs in for a function, then it should at
> least be correct! Could someone fix the docs up?
> Or perhaps the docs should include a note saying 'This doesn't work as
> Or, is the documentation correct, and the code buggy?
Suspect the docs are wrong.
> I don't have enough D::C-fu to know myself.
> One thing that definately doesn't seem to work as specified is the optionality
> of the nested join block.
The examples presented are ripped straight out of the tests, and as such
are pretty definitely ok.
I think the mistake is simply that the *contents* of the nested join
block are optional (if you don't have a nested join) but the arrayref
itself, while it might be empty, isn't.
Can whoever originally wrote this step up and correct it please?
More information about the Dbix-class