-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
includes not taken into account #3
Comments
I can confirm this. My setup:
Saying
which failed with:
Adding a
|
It is definitely possible that making a Model mappable through another one fails. I know that I've tried to make this work yet. I've just copied the original code. I don't think that you should need to add an include scope in the query chain, geokit-rails3 should do this for you when it notices that you use a :through option. But as I've just said, I'm pretty sure it is not working right now. If it is something that is important to you, you can fork the repository and try to make this work. I'd be happy to merge a pull request from you (or anyone else) if it has the corresponding tests. |
Cool. I'll do some investigation and let you know. |
I can confirm this same issue. Your workaround works, thanks. I patched it right in the model by overriding the within method like so:
|
Big thanks for that workaround :) |
I have a fix for this in #8. |
Thanks @cbartlett - using your workaround |
I have a model,
User
, with the following line:acts_as_mappable :through => { :profile => :address }
I expected the following to work:
User.in_bounds(bounds).all
It doesn't. I get error messages like
Unknown column 'addresses.lat' in 'where clause'
. I need to do the following:User.includes(:profile => :address).in_bounds(bounds).all
...and everything will work.
The text was updated successfully, but these errors were encountered: