[Dbix-class] join and where

Brandon Black blblack at gmail.com
Thu Jan 4 22:36:50 GMT 2007


On 1/4/07, Fernan Aguero <fernan at iib.unsam.edu.ar> wrote:
> +----[ Patrik Wallstrom <pawal at blipp.com> (04.Jan.2007 18:30):
> | I really can't figure out how to do it from the artist/cd examples in
> | cookbok. Subscription has not a direct relation with item.
>
> but why then are you joining on feed_id? To me this looks
> like a relation.
>

Basically its an implied relation.  If foo has_many bar, and bar
has_many baz, then its implied that foo has_many baz.  If you don't
use the implied/indirect relationship often, use the join syntax like
Fernan wrote for those one-off queries.  If you'll probably use it a
lot, you could just define an has_many and/or belongs_to directly
between these tables.



More information about the Dbix-class mailing list