Skip to content
Discussion options

You must be logged in to vote

Guess I gave up too soon. Reviewing the docs for associations to multiple tables, I found that when I do it like this in the model file's config():

hasOne(name="userArea", modelName="lookup_value", foreignKey="id", joinKey="area_id");

and in the controller file action:

users = model("user").findAll(include="userArea");

it works.

I also found how to join multiple tables there in the docs (doh!), just csv list of association names in that include list value...
include="userArea,userRole"

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by cfcoder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant