Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress deprecation warnings of Active Record #2312

Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Next

Suppress "Delegating exists to arel is deprecated" warning

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 4, 2018
commit fb8409ec35dcf6d285f556997ff43943a1ba4109
@@ -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
@@ -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
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.