Commit b15e631e authored by Stan Hu's avatar Stan Hu Committed by Heinrich Lee Yu

Remove Rails deprecation warning in CommitStatus

This removes the deprecation warning:

```
DEPRECATION WARNING: Class level methods will no longer inherit
scoping from `match_id_and_lock_version` in Rails 6.1. To continue using
the scoped relation, pass it into the block directly. To instead access
the full set of models, as Rails 6.1 will, use `CommitStatus.unscoped`,
or `CommitStatus.default_scoped` if a model has default scopes. (called
from block (2 levels) in <class:CommitStatus> at
/home/git/app/models/commit_status.rb:69
```

This was introduced in https://github.com/rails/rails/pull/35186.
parent 438e0332
......@@ -66,7 +66,7 @@ class CommitStatus < ApplicationRecord
# it expects that items are an array of attributes to match
# each hash needs to have `id` and `lock_version`
slice.inject(self) do |relation, item|
match = CommitStatus.where(item.slice(:id, :lock_version))
match = CommitStatus.unscoped.where(item.slice(:id, :lock_version))
relation.or(match)
end
end
......
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