-
Notifications
You must be signed in to change notification settings - Fork 61
Add with_deleted scope #77
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
Conversation
|
@simi Can you take a look pls? |
spec/mongoid/paranoia_spec.rb
Outdated
|
|
||
| before do | ||
| Mongoid.configure do |config| | ||
| config.try(:allow_scopes_to_unset_default_scope=, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why try? Possible to also store original value and set back after the test?
spec/mongoid/paranoia_spec.rb
Outdated
| it "returns the deleted documents" do | ||
| expect(with_deleted).to eq(posts) | ||
| end | ||
| end if respond_to?(:allow_scopes_to_unset_default_scope=) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it ask Mongoid.respond_to? 🤔?
|
@simi Made changes as per your suggestions. |
|
@simi ping 🙂 |
|
👀 |
|
Thanks a lot! |
|
Great, thanks! Hoping for a release soon 😁 |
Added the
with_deletedscope as discussed in #75Not sure if the feature guards in specs are okay like this.
Also, another option for the scope definition is to completely wrap it in the conditional instead of raising inside.