Jeremy Evans: > The array of two element arrays is treated like a hash except that you > can have multiple identical keys (necessary in this case). It would > probably would help to see the SQL produced for labels = ['a', 'b']:
> SELECT * FROM signatures
> WHERE ((id IN (SELECT signature_id FROM labels_signatures INNER JOIN labels
> ON (labels.id = labels_signatures.label_id) WHERE (label.name = 'a'))) AND
> (id IN (SELECT signature_id FROM labels_signatures INNER JOIN labels
> ON (labels.id = labels_signatures.label_id) WHERE (label.name = 'b'))))
> ORDER BY random() LIMIT 1
Ah, that makes perfect sense now! Thanks
for the explanation (and the patience). :)
— Piotr Szotkowski
--
IMO, the primary historical significance of Unix is that it marks
the time in computer history where CPUs became so cheap that it was
possible to build an operating system without adult supervision.
[Russ Holsclaw, afc]
signature.asc
Description: Digital signature
