HABTM round trip query

2013-02-10 Thread crouch...@googlemail.com
Hi all, If this topic is covered, sorry, but I don't really know what to search under and all my searches resulted in nothing. Background: Developing a site for a voice over company. Requirement: Voice artists can have several different languages and languages can have several different voice

Re: HABTM round trip query

2013-02-10 Thread lowpass
Try this. I'm assuming your languages table has a 'code' column and the request passes a 2-letter string for the code for the desired language. That's probably how I'd do it but you may need to modify for your own setup. (This would be in the Language model.) public function

Re: HABTM round trip query

2013-02-10 Thread lowpass
I forgot the Language model to get the *other* langs the artist uses. public function getArtistsForLang($lang) { return $this-find( 'all', array( 'conditions' = array( $this-alias.'.code' = $lang