toptal / chewy

High-level Elasticsearch Ruby framework based on the official elasticsearch-ruby client
MIT License
1.88k stars 364 forks source link

Make default index scope cleanup behavior configurable #925

Closed barthez closed 7 months ago

barthez commented 7 months ago

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:

barthez commented 7 months ago

@toptal-anvil ping reviewers

barthez commented 7 months ago

@toptal-anvil ping reviewers