activerecord-bitemporal icon indicating copy to clipboard operation
activerecord-bitemporal copied to clipboard

Remove unneeded unscope values

Open wata727 opened this issue 1 year ago • 0 comments

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 avatar Apr 09 '24 10:04 wata727