diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2018-08-27 18:31:01 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2018-09-11 18:32:00 +0300 |
commit | 2039c8280db1646845c33d6c5a74e5f23ca6f4de (patch) | |
tree | e2b3cd3012d9711cda7c6afb962ae4228d59521a /app/finders/autocomplete | |
parent | 91c40973dc620430b173ea2df968587d2a708dff (diff) |
Disable existing offenses for the CodeReuse cops
This whitelists all existing offenses for the various CodeReuse cops, of
which most are triggered by the CodeReuse/ActiveRecord cop.
Diffstat (limited to 'app/finders/autocomplete')
-rw-r--r-- | app/finders/autocomplete/users_finder.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/finders/autocomplete/users_finder.rb b/app/finders/autocomplete/users_finder.rb index b2557469079..e2283f3266e 100644 --- a/app/finders/autocomplete/users_finder.rb +++ b/app/finders/autocomplete/users_finder.rb @@ -44,6 +44,7 @@ module Autocomplete # Returns the users based on the input parameters, as an Array. # # This method is separate so it is easier to extend in EE. + # rubocop: disable CodeReuse/ActiveRecord def limited_users # When changing the order of these method calls, make sure that # reorder_by_name() is called _before_ optionally_search(), otherwise @@ -61,6 +62,7 @@ module Autocomplete .limit(LIMIT) .to_a end + # rubocop: enable CodeReuse/ActiveRecord def prepend_current_user? filter_by_current_user.present? && current_user @@ -70,6 +72,7 @@ module Autocomplete author_id.present? && current_user end + # rubocop: disable CodeReuse/ActiveRecord def find_users if project project.authorized_users.union_with_user(author_id) @@ -81,5 +84,6 @@ module Autocomplete User.none end end + # rubocop: enable CodeReuse/ActiveRecord end end |