Skip to content

Commit

Permalink
Suppress "Delegating exists to arel is deprecated" warning
Browse files Browse the repository at this point in the history
This commit suppresses the following Active Record warnings.

```console
DEPRECATION WARNING: Delegating exists to arel is deprecated and will be
removed in Rails 6.0. (called from pull_request_filter at
/Users/koic/src/github.com/24pullrequests/24pullrequests/app/models/aggregation_filter.rb:7)

DEPRECATION WARNING: Delegating with to arel is deprecated and will be
removed in Rails 6.0. (called from block (4 levels) in <top (required)>
at /Users/koic/src/github.com/24pullrequests/24pullrequests/spec/controllers/users_controller_spec.rb:16)
```

This patch is based on the following comment.
rails/rails#29619 (comment)
  • Loading branch information
koic committed Sep 5, 2018
1 parent c0c323e commit fb8409e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/aggregation_filter.rb
Expand Up @@ -4,6 +4,6 @@ class AggregationFilter < ApplicationRecord
def self.pull_request_filter
where("pull_requests.user_id = aggregation_filters.user_id")
.where("pull_requests.title ILIKE aggregation_filters.title_pattern")
.exists.not
.arel.exists.not
end
end
2 changes: 1 addition & 1 deletion spec/controllers/users_controller_spec.rb
Expand Up @@ -13,7 +13,7 @@
get :index
end

it { expect(assigns(:users).with(User.order('pull_requests_count desc').page(0))).to be_truthy }
it { expect(assigns(:users).arel.with(User.order('pull_requests_count desc').page(0))).to be_truthy }
end

context 'as json' do
Expand Down

0 comments on commit fb8409e

Please sign in to comment.