Code Monkey home page Code Monkey logo

Comments (14)

anuja-joshi avatar anuja-joshi commented on July 26, 2024

@Loschcode this is happening because of BSON::Regexp::Raw.new(escaped_pattern) at line https://github.com/mongoid/mongoid-slug/blob/master/lib/mongoid/slug/unique_slug.rb#L133
If you have old bson version it does not have default option parameter so "initialize" is throwing argument error. Default option parameter support is added to bson - v4.2.1

from mongoid-slug.

Loschcode avatar Loschcode commented on July 26, 2024

How can I fix that ? Should I upgrade MongoID ?

from mongoid-slug.

dblock avatar dblock commented on July 26, 2024

It does look like a bug, as we support mongoid 3-whatever, so I'd appreciate a spec and a fix, please.

from mongoid-slug.

Loschcode avatar Loschcode commented on July 26, 2024

is there any solution ? I'm waiting for a fix to include it within my project ... Maybe I could help but I don't know the codebase at all.

from mongoid-slug.

dblock avatar dblock commented on July 26, 2024

What version of mongoid-slug are you using? I believe 5.3.3 via #240 fixes your problem, can you please confirm?

from mongoid-slug.

Loschcode avatar Loschcode commented on July 26, 2024

I'm currently using mongoid-slug (5.3.3) which seems to be the latest one

from mongoid-slug.

dblock avatar dblock commented on July 26, 2024

And which version of mongoid?

If you look at https://github.com/mongoid/mongoid-slug/blob/master/lib/mongoid/slug/unique_slug.rb#L133, with Mongoid 3 and 4 you should not hit that code.

from mongoid-slug.

Loschcode avatar Loschcode commented on July 26, 2024

The version I see in the Gemfile.lock is mongoid (5.0.2) is that fine ?

from mongoid-slug.

dblock avatar dblock commented on July 26, 2024

I was confused. Just try to upgrade bson-4.1.1 to bson-4.2.1, bundle update bson?

from mongoid-slug.

Loschcode avatar Loschcode commented on July 26, 2024

I updated BSON such as Installing bson 4.2.2 (was 4.1.1) and it now has a different error

$ rake mongoid_slug:set
/Users/loschcode/.rvm/gems/ruby-2.3.3/gems/mongoid-slug-5.3.3/lib/tasks/mongoid_slug.rake:7: warning: constant ::TimeoutError is deprecated

What should I do next ?

from mongoid-slug.

dblock avatar dblock commented on July 26, 2024

That's a warning, not an error. It worked no?

from mongoid-slug.

Loschcode avatar Loschcode commented on July 26, 2024

It seems to work, I guess it's the end of the issue then

from mongoid-slug.

dblock avatar dblock commented on July 26, 2024

Maybe that task should log something :) Feel free to contribute!

from mongoid-slug.

alaouy avatar alaouy commented on July 26, 2024

I ran to the same issue, I confirm that upgrading bson to v4.2.2 actually fixed the problem.

from mongoid-slug.

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.