Skip to content

Conversation

@stanley90
Copy link
Contributor

Added the with_deleted scope as discussed in #75
Not 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.

@stanley90 stanley90 mentioned this pull request Jul 31, 2025
@stanley90
Copy link
Contributor Author

@simi Can you take a look pls?


before do
Mongoid.configure do |config|
config.try(:allow_scopes_to_unset_default_scope=, true)
Copy link
Owner

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?

it "returns the deleted documents" do
expect(with_deleted).to eq(posts)
end
end if respond_to?(:allow_scopes_to_unset_default_scope=)
Copy link
Owner

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? 🤔?

@stanley90
Copy link
Contributor Author

@simi Made changes as per your suggestions.

@stanley90
Copy link
Contributor Author

@simi ping 🙂

@simi
Copy link
Owner

simi commented Dec 2, 2025

👀

@simi simi merged commit d97dcf6 into simi:master Dec 2, 2025
17 checks passed
@simi
Copy link
Owner

simi commented Dec 2, 2025

Thanks a lot!

@stanley90
Copy link
Contributor Author

Great, thanks! Hoping for a release soon 😁

@stanley90 stanley90 deleted the with_deleted branch December 2, 2025 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants