Skip to content

Commit 97a3852

Browse files
author
Kit (OpenClaw)
committed
fix: apply Mongoid 8 any_of fixes to activity_view_model and tax/rate
- admin/activity_view_model.rb: collect any_of clauses into array and call any_of(*clauses) once outside the loop; avoids AND-of-ORs in Mongoid 8 when multiple IDs are provided (WA-VERIFY-091) - core/tax/rate.rb: splat clauses array in any_of call to match Mongoid 8 variadic signature (WA-VERIFY-091) Note: branch also includes WA-VERIFY-089 count→size changes from prior commit.
1 parent 568ab83 commit 97a3852

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

admin/app/view_models/workarea/admin/activity_view_model.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,13 @@ def scoped_entries
6060
end
6161

6262
if options[:id].present?
63-
Array(options[:id]).each do |id|
64-
criteria = criteria.any_of(
63+
clauses = Array(options[:id]).flat_map do |id|
64+
[
6565
{ audited_id: id },
6666
{ 'document_path.id' => convert_to_object_id(id) }
67-
)
67+
]
6868
end
69+
criteria = criteria.any_of(*clauses) unless clauses.empty?
6970
end
7071

7172
if options[:created_at_greater_than].present?

core/app/models/workarea/tax/rate.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def self.search(query)
4343
clauses = [{ region: regex }, { postal_code: regex }]
4444
clauses << { country: country } if country.present?
4545

46-
any_of(clauses)
46+
any_of(*clauses)
4747
end
4848

4949
def self.sorts

0 commit comments

Comments
 (0)