Skip to content

Remove unneeded unscope values#159

Merged
wata727 merged 1 commit intokufu:masterfrom
wata727:remove_unneeded_unscope_values
May 7, 2024
Merged

Remove unneeded unscope values#159
wata727 merged 1 commit intokufu:masterfrom
wata727:remove_unneeded_unscope_values

Conversation

@wata727
Copy link
Copy Markdown
Contributor

@wata727 wata727 commented Apr 9, 2024

Unscope values in the bitemporal_default_scope were introduced in this commit.

Since it is faster to build a query explicitly with a where clause than with a scope call, we hacked the unscope_values that Active Record uses internally and implemented overrides of valid_from/to and transaction_from/to.

However, in the next commit, where! is replaced by _valid_from_lteq and _valid_to_gt, which use rewhere. When using rewhere, there is no need to override the original condition by unscoped values, so this can simply be removed.

@wata727 wata727 marked this pull request as ready for review April 9, 2024 10:44
@auto-assign auto-assign bot requested review from QWYNG and mkmn April 9, 2024 10:44
@wata727 wata727 requested a review from osyo-manga April 9, 2024 10:44
Copy link
Copy Markdown
Contributor

@mkmn mkmn left a comment

Choose a reason for hiding this comment

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

👍

@wata727 wata727 merged commit 60bcbcb into kufu:master May 7, 2024
@wata727 wata727 deleted the remove_unneeded_unscope_values branch May 7, 2024 05:45
@wata727 wata727 mentioned this pull request May 8, 2024
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