-
Notifications
You must be signed in to change notification settings - Fork 32
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
find() through association isn't using translation table #1
Comments
This is "normal" because find is not surcharged in Friendly ID 5. A proxy must be used like this 👍
I don't know if it's working on an association ? |
Per the new Friendly_id 5 config file, setting Unfortunately the OP's problem persists. Finding through an association seems currently not possible with v5. |
@yadoga Finding through an association is partly broken because of bugs in Rails 4.0 that will be fixed in 4.0.1. You might want to check and see if the issue described in norman/friendly_id#452 is what's affecting you. |
Thanks for your reply @norman. I'm afraid I'm using Rails 4.0.1 here on my end and the problem persists. Maybe you meant the "5.0.1" version of Friendly_id instead? |
I believe he meant 5.0.1 wich will depend on 4.0.1 On 4 nov. 2013, at 18:04, yadoga notifications@github.com wrote:
|
Norman speaks of Active Record 4.0.1 in the referenced thread above. Curiously it's now out and does not seem to solve the issue. I'd love my friendly_id healthy again. Please please with sugar on top. |
Unfortunately I've never used the globalize functionality and for the next several months need to focus on maintaining Haml. I spent about 2 months working on FriendlyId to the exclusion of Haml and now I need to catch up with pending issues and requests over there. @parndt, the primary maintainer of Globalize and its integration with FriendlyId, is busy with work and other high priority open source projects. It would be fantastic if somebody with a little time to spare could give us a hand with this. |
Does Rails 4.0.1 not fix this issue? |
Hi Philip, glad to see you around! Unfortunately the error persists with Rails 4.0.1. Just double checked this. Finding a translated title through an association still returns 'RecordNotFound' as described in the first comment. |
Can anybody make a simple reproducing test case that can be added to the library? This makes it a lot easier to fix. The original post assumes I have a |
ok, setting one up. |
Test Case here: In this case as "User has_many Pages". |
Outch, too late a night for me. Setting up a real test case now, not only a test app. |
Testing currently gives me other unrelated errors (Gem.source_index, …), so I'm not able to provide a valid test for the moment. Can anybody give a hand here and set one up? |
This seems to be general globalize issue. I added it here: globalize/globalize#303 |
Fix slug generation when single translation exists
Using find() directly on my model generates a query which looks up the slug in the page_translations table:
When I use find through a association, the translation table isn't being used. friendly_id uses the orginal table instead.
In Rails 3.2 (friendly_id 4.0.10, globalize 3.0.0) it works like this:
The text was updated successfully, but these errors were encountered: