Commit 4808039c authored by Igor Drozdov's avatar Igor Drozdov

Fix passing dynamic kwargs to where scope

When a hash passed along with kwargs, only the first statement
wins in Rails 6.1:

```ruby
Group.where({ created_at: 30.days.ago..2.days.ago }, id: 1)
```

Takes only the first argument into account.

In Rails 6.1 it should be passed as:

```ruby
Group.where(created_at: 30.days.ago..2.days.ago, id: 1)
```

That's why we need a splat operator here.
parent ffc16c43
......@@ -607,7 +607,7 @@ module Gitlab
unique_users_all_imports: unique_users_all_imports(time_period),
bulk_imports: {
gitlab: DEPRECATED_VALUE,
gitlab_v1: count(::BulkImport.where(time_period, source_type: :gitlab))
gitlab_v1: count(::BulkImport.where(**time_period, source_type: :gitlab))
},
project_imports: project_imports(time_period),
issue_imports: issue_imports(time_period),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment