Skip to content

Commit 60bcbcb

Browse files
authored
Merge pull request #159 from wata727/remove_unneeded_unscope_values
Remove unneeded unscope values
2 parents e8f4263 + 385c3d8 commit 60bcbcb

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

lib/activerecord-bitemporal/scope.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,6 @@ def _#{column}_#{op}(datetime)
355355
relation.bitemporal_value[:with_transaction_datetime] = :default_scope
356356
end
357357

358-
# Calling scope was slow, so don't call scope
359-
relation.unscope_values += [
360-
{ where: "#{table.name}.transaction_from" },
361-
{ where: "#{table.name}.transaction_to" }
362-
]
363358
relation = relation
364359
._transaction_from_lteq(transaction_datetime || datetime)
365360
._transaction_to_gt(transaction_datetime || datetime)
@@ -375,10 +370,6 @@ def _#{column}_#{op}(datetime)
375370
relation.bitemporal_value[:with_valid_datetime] = :default_scope
376371
end
377372

378-
relation.unscope_values += [
379-
{ where: "#{table.name}.valid_from" },
380-
{ where: "#{table.name}.valid_to" }
381-
]
382373
relation = relation
383374
._valid_from_lteq(valid_datetime || datetime)
384375
._valid_to_gt(valid_datetime || datetime)

0 commit comments

Comments
 (0)