Giter Club home page Giter Club logo

Comments (10)

norman avatar norman commented on May 21, 2024

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.

nateabbott avatar nateabbott commented on May 21, 2024

no problem -- thanks again for your work on this!

from friendly_id.

Exide avatar Exide commented on May 21, 2024

Removing cached slugs isn't a viable workaround as the scope is still not updated in the slugs table.

from friendly_id.

mrrooijen avatar mrrooijen commented on May 21, 2024

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.

norman avatar norman commented on May 21, 2024

@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.

mrrooijen avatar mrrooijen commented on May 21, 2024

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.

norman avatar norman commented on May 21, 2024

Updating models used as scope now updates scoped slugs. Closed by 635cc0c.

from friendly_id.

mrrooijen avatar mrrooijen commented on May 21, 2024

Thanks a bunch! I will try it out soon and let you know!

from friendly_id.

norman avatar norman commented on May 21, 2024

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.

mrrooijen avatar mrrooijen commented on May 21, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.