[Dbix-class] ping 'from' attribute doc author: you need to fix them
Matt S Trout
dbix-class at trout.me.uk
Wed May 10 19:00:12 CEST 2006
Toby Corkindale wrote:
> It's not neccessary, but I *should* be able to use 'from' to do what I was
> doing. Even if I didn't need it then, I will probably need it in the future.
> (Either that, or I have to break out the Real SQL (tm) to do anything complex..
> which sort of defeats the point.)
It's amazing how complex you can get with the built-in stuff. If you
manage to exceed that, first stop is to bitch on the list, since (1) you
probably only think you've exceeded it, (2) if you have there's usually
an SQL-free workaround.
> Yeah, which was that "single()" doesn't support attributes, something which is
> easy overlooked in the docs, since it says for single that it is "like a search
> that automatically expands just the first result".
That's cos I documented that one, and dammit the arguments list tells
you it doesn't take one of those.
At some stage somebody who writes less terse docs than I will almost
certainly replace it.
>>> 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.
> WHen I was experimenting with it, that didn't appear to be the case.
> The addition of an empty  arrayref merely caused a different error to turn up
> (complaining about lack of contents of above array) I think..
>> Can whoever originally wrote this step up and correct it please?
And figure out how the hell it actually works, since I've apparently
forgotten. I just let DBIC do it for me :)
> And perhaps add another couple of tests to your test suite?
Since DBIC resolves 'join' to 'from' internally, the functionality is
already pretty well tested, I suspect ...
More information about the Dbix-class