Open stanley90 opened 3 months ago
Feel free to open PR. Just wondering how to detect related feature is present, using Mongoid version check?
In my app I patched Mongoid::Scopable::ClassMethods
to add the feature until I upgrade Mongoid (I'm at 7.5).
To be safe, I can check for Mongoid::Config.respond_to?(:allow_scopes_to_unset_default_scope)
and only then define the scope (the desired behavior might be default since Mongoid 10, but that will take some time). Would that be acceptable? I can open a PR this week.
@stanley90 sounds good
Actually need to wait until next Mongoid 9 release. Will come back.
Hi, I needed to have an option to remove the paranoia condition from an already-chained query (so can't use
unscoped
anymore), so I added the following scope:scope :with_deleted, -> { criteria.remove_scoping(base.unscoped.where(deleted_at: nil)) }
Would you consider including it in Paranoia? (note: it depends on this https://github.com/mongodb/mongoid/pull/5832) Thanks