-
Notifications
You must be signed in to change notification settings - Fork 57
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
globalize2 makes too many extra queries #33
Comments
I was minimizing queries by running Post.all(:include => :translations) That worked a couple of months ago before svenfuchs refactoring - it should still work. Does that help you ? |
It didn't work for me:
|
uhm try the plural: :translations |
I actually tried both, not sure why I pasted the singular one.
|
okay sorry so its page_translations i guess - look it up in your schema ;) |
hukl, are you meaning just a plain old Rails :include? I've tried that, but it didn't work, even though the table exist, the model and the association seem not to, there's no PageTranslation model:
|
http://github.com/hukl/cccms/blob/master/app/models/page.rb Not sure though if its using the latest globalize version |
I'm sorry, I'm not sure what I'm looking at in there. Does that work with your code snippet? Your page looks like my page (regarding translations). |
come on - read the source luke - its really not that hard … |
That might have worked in an old version of globalize2, but it doesn't work anymore.
Maybe the old version set up an association, but without it, include won't ever work (adding the square brackets doesn't really change anything here). |
Sorry but for my example I created a fresh rails app and installed globalize2 from github |
I'm trying to lower the amount of queries my app is making and half of the queries are due to globalize2 and I couldn't found a way to minimize that.
http://stackoverflow.com/questions/3006938/fetch-main-model-and-translations-in-one-query-with-globalize2
The text was updated successfully, but these errors were encountered: