Skip to content

Add with_deleted scope#77

Merged
simi merged 3 commits into
simi:masterfrom
stanley90:with_deleted
Dec 2, 2025
Merged

Add with_deleted scope#77
simi merged 3 commits into
simi:masterfrom
stanley90:with_deleted

Conversation

@stanley90

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

@simi Can you take a look pls?

Comment thread spec/mongoid/paranoia_spec.rb Outdated

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

Copy link
Copy Markdown
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?

Comment thread 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=)

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

@simi Made changes as per your suggestions.

@stanley90

Copy link
Copy Markdown
Contributor Author

@simi ping 🙂

@simi

simi commented Dec 2, 2025

Copy link
Copy Markdown
Owner

👀

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

simi commented Dec 2, 2025

Copy link
Copy Markdown
Owner

Thanks a lot!

@stanley90

Copy link
Copy Markdown
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