Comments (10)
Thanks, I think your explanation is actually crystal clear. I'll work on a patch for that, but it will likely not be ready today. Probably Thursday or Friday. I have a few other bugs related to scopes to work on, as well as a contributed patch pending, so I'll be doing a small overhaul of the scope features. In the mean time I'd suggest not using cached slugs if this is causing problems for your application, and count on being able to turn them back on by early next week at latest.
from friendly_id.
no problem -- thanks again for your work on this!
from friendly_id.
Removing cached slugs isn't a viable workaround as the scope is still not updated in the slugs table.
from friendly_id.
I believe I am experiencing the same issue. I have an application where I have:
Art {nested in} Albums {nested_in} Users. When I update the album_id of my Art model. it will be placed under a different album and will not be accessible through the browser as it will raise the following exception: Cannot find Art with id = "something" and scope = "old album scope". (or something along those lines).
Is this the issue that is being discussed here?
Thanks!
from friendly_id.
@meskyanichi yes, that sounds like it's the same issue.
I have a received a pull request for a patch which fixes this issue. I'm currently on vacation and will be back home on Tuesday; I'll apply the patch then. In the mean time, you can check out this fork and see if it works for you.
from friendly_id.
Hi Norman. Thanks for the reply.
I installed the fork as a plugin, and clone'd it and built a gem and installed that, but both didn't solve the issue. The slug remained unchanged.
Also, after installing the fork gem I receive this error:
undefined method `friendly_id_options' for #Class:0x105115548
Which I noticed was added in the fork. But apparently it could not find it or something.
Anyway no rush or anything, just pointing it out.
Enjoy your vacation, have a good one! ;)
And thanks for building such a sweet gem, it's a great solution and I started using it on every project! This just happens to be the first one I'm scoping with. :)
from friendly_id.
Updating models used as scope now updates scoped slugs. Closed by 635cc0c.
from friendly_id.
Thanks a bunch! I will try it out soon and let you know!
from friendly_id.
Ah, I didn't realize Github parses the commit messages to automatically close issues now. I had actually intended to leave this open until I pull in @amiablecoder's changes to the master branch. Right now edge and master are significantly different; it was much easier to fix in edge so that's already done. You may wish to give the edge branch a try; all tests pass and I won't be making any more major changes before releasing 2.3.0, though of course there may be bugs. It's a pretty significant refactor.
@amiablecoder the only major issue I've seen so far with the fork is that it doesn't work when the model used as the scope uses slugs, I think it should work with both slugged and non-slugged.
from friendly_id.
@amiablecoder Hi, It seems that you've resolved my problem! When I update my top-level association. All children beneath that, and all children beneath these children will get their scopes updated as needed. Thanks a lot for this fix!
from friendly_id.
Related Issues (20)
- friendly_id tripping NotNullViolation in Postgres
- `allow_nil: true` on the find method does not work as expected. HOT 7
- normalize_friendly_id not working in a concern HOT 2
- Yard fails to load the gem HOT 5
- Re-enable numeric sequences? HOT 1
- FriendlyId and CanCanCan and redirects
- Generate slug with a `name` and `id` of the record
- :history fails when trying to reuse slugs HOT 1
- Slug regenerated
- Find_by return an nill
- UUID set as slug on failed validations on base column HOT 1
- Error in the doc
- support for Arabic, Persian and other RTL languages
- 5.5.1 release request HOT 3
- Rails 7.1 composite key support
- History does not use parse_friendly_id
- Setting slug_limit in initialiser crashes rspec tests HOT 3
- How can I handle this scoped slug use case without a new option from Friendly ID to disable UUID generation? HOT 2
- Advise users on skipping lazy loaded associations HOT 1
- Collisions when using finder with Rails STI subtypes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from friendly_id.