diff options
author | Stan Hu <stanhu@gmail.com> | 2019-02-17 01:26:15 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-02-20 02:36:05 +0300 |
commit | e87c255d9e76fb3ca691267107e83d48c90bc816 (patch) | |
tree | 9ff03ae5830a34f1269a82f482f967adb213d82a /app/models/user.rb | |
parent | ab9f8785ebf5483e5d2cd02497b57fa05a47561e (diff) |
Make Admin::UsersController work with Ruby 2.6
Ruby 2.6 introduced `Enumerable#filter`, which takes no arguments.
Attempting to call `filter` on an `ActiveRecord::Relation` with a scope
will fail with a `wrong number of arguments (given 1, expected 0)`
message because the `Enumerable#filter` implementation overrides the
delegated `ActiveRecord::Relation#filter` method.
To make Admin::UsersController compatible with Ruby 2.6, rename
`User.filter` to `User.filter_items`.
Diffstat (limited to 'app/models/user.rb')
-rw-r--r-- | app/models/user.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index fd32d838e53..ee51c35d576 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -388,7 +388,7 @@ class User < ApplicationRecord find_by(id: user_id) end - def filter(filter_name) + def filter_items(filter_name) case filter_name when 'admins' admins |