[Nitro] Regarding :include and :select and some SQL questions

Rui Miguel ravage at fragmentized.net
Sat Aug 11 23:05:44 EDT 2007


Attached is included some Og tests which fail using these  
functionalities together. Hope i'm not doing anything wrong and  
appreciate correction if i am.

:select is very sensible and should be taken to attention if it gets  
included in Nitro because when used with :include doesn't work.

Implementation should be thought carefully. When using :select  
with :include it's necessary to know, to which model a field refers,  
which should be described when passing the :select argument to avoid  

The current code breaks when passing two fields to :select.
I changed it a bit so it would work when passing two or more  
parameters, that's when i add the field ambiguity issue described above.

Regarding :include, would it be possible to change SQL generation  
into "LEFT JOIN table2 ON table1.field = table2.field?

Regarding Model.select, should this work,
Model.select("select nome from ogaluno where turma_oid not in (select  
oid from ogturma)"), returning only field "nome"? or how should it  
behave? Just curious. Or a more simple one like Model.select("SELECT  
* FROM oguser").

Rui Miguel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: og_tests.patch
Type: application/octet-stream
Size: 55723 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070812/54c7e8b5/attachment-0001.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070812/54c7e8b5/attachment-0001.bin 

More information about the Nitro-general mailing list