-
Notifications
You must be signed in to change notification settings - Fork 7
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
Scoped support? #7
Comments
I made a comment on refinery/refinerycms#3360, but basically FriendlyId::Mobility doesn't do anything in particular for However, because Mobility doesn't monkey-patch ActiveRecord, the order in which things happen in your model is important. For friendly_id :title, use: [:history, :mobility] so I believe the same is true for scoped (if so I need to add this to the readme on this repo): friendly_id :title, use: [:scoped, :mobility] It seems that in that other PR, the order is reversed, which means that |
I'm not sure though that that will fix it. If not, I'll add some specs here on |
Actually, thinking about this again, I don't think that alone will fix it. The problem is that unlike Globalize, Mobility doesn't patch AR query methods globally, only through the |
Thanks for your quick answer !
It looks like this helps a little: refinery/refinerycms@836e050 It fixes 20 specs but not all slug specs! :) |
Ok that's good! Ideally though, this gem should allow you to use |
I'm pretty busy this week, will try to get to this next week. I don't think it should be much work to get scoped support. Ideally I'd like to just import scoped specs from FriendlyId and test against them, with changes to test that Mobility finds work (similar to how other tests are done in this gem right now). |
Of course if you want to give it a shot, that's also always welcome 😄 |
I'm made my early tests the last night, i will try to send you a PR if i find something interesting. |
Any chance to fix this issue? Scoped does not work for me. I am using it in a self referential relationship ie. categories with sub categories. |
Hi @shioyama !
Thanks for your awesome work on mobility!
I'm in the process of switching from globalize to mobility for refinerycms refinery/refinerycms#3360
I have a lot of fails specs due to this config: https://github.com/refinery/refinerycms/blob/master/pages/app/models/refinery/page.rb#L36-L37
I'm not sure if it's because
friendly_id-mobility
gem does not supportscoped
feature or if i have another bug.Do you have any idea?
The text was updated successfully, but these errors were encountered: