Skip to content
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

Make default index scope cleanup behavior configurable #925

Merged
merged 2 commits into from
Jan 30, 2024

Conversation

barthez
Copy link
Contributor

@barthez barthez commented Jan 29, 2024

Instead of warning, you can completely ignore cases when the scope include order/offset/limit or you can raise an exception instead.

This change is actually a performance improvment. Avoiding arel calls to identify it default scope has order/offset/limit is time consuming and we don't need to verify it every time we boot.

Additional option of raising an exception might be useful for tests to prevent defining scopes with ordering or pagination.


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Added an entry to the changelog if the new code introduces user-observable changes. See changelog entry format for details.

Instead of warning, you can completely ignore cases when the scope
include order/offset/limit or you can raise an exception instead.
@barthez barthez requested review from konalegi and a team January 29, 2024 15:28
@barthez
Copy link
Contributor Author

barthez commented Jan 29, 2024

@toptal-anvil ping reviewers

@@ -4,6 +4,8 @@

### New Features

* [#925](https://github.com/toptal/chewy/pull/925): Add configuration option for default scope cleanup behavior. ([@barthez][])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please provide a readme

@barthez barthez force-pushed the import-scope-cleanup-behavior branch from 2ec9bde to 2307131 Compare January 30, 2024 09:15
@barthez barthez force-pushed the import-scope-cleanup-behavior branch from 2307131 to d516fa4 Compare January 30, 2024 09:31
@barthez barthez requested a review from konalegi January 30, 2024 09:31
@barthez
Copy link
Contributor Author

barthez commented Jan 30, 2024

@toptal-anvil ping reviewers

Copy link
Contributor

@konalegi konalegi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@barthez barthez merged commit 8604b4a into master Jan 30, 2024
10 checks passed
@barthez barthez deleted the import-scope-cleanup-behavior branch January 30, 2024 11:48
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.

3 participants