Hi,
I have a user model that has a couple of other models(like street
address, tasks).
suppose
User has a name field
Address has a state field.
so I want to provide a detailed search form each field in the user and
its related
models can be specified.
Suppose I have a user that has a name “california”, and that user has a
address with the state field being “california” as well.
I use AAF’s multi_search:
User.multi_search(‘state:(california)’, [Address, Task])
returns the correct address instance
User.multi_search('name:(california) ', [Address, Task])
returns the correct user instance
User.multi_search('name|state:(california) ', [Address, Task])
return both the address and user instances where the address actually
belongs to the user that’s returned. how can I just get one result
returned? Otherwise, I’d need to merge these two results because they
really represent the same user. I understand that I can define a new
method to return the state in the user model. But I have many other
models that belong to a user. so it’s going to be very tedious to add
all the new accessor methods just for AAF.
User.multi_search('name:(california) state:(california) ', [Address,
Task])
doesn’t return any instance. why is this not returning anything?
Thanks.
yaxm