From a69f889101b9feacd6ac55ebf7e3c6334abb792f Mon Sep 17 00:00:00 2001 From: Peter Leitzen Date: Fri, 12 Apr 2019 12:16:06 +0000 Subject: [PATCH] Remove User#internal_attributes method It's not needed anymore as we've replaced boolean `support_bot` with enum `bot_type`. --- app/models/user.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index d3524bfd6ae..b08ac638949 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -537,20 +537,16 @@ class User < ApplicationRecord username end - def self.internal_attributes - [:ghost] - end - def internal? - self.class.internal_attributes.any? { |a| self[a] } + ghost? end def self.internal - where(Hash[internal_attributes.zip([true] * internal_attributes.size)]) + where(ghost: true) end def self.non_internal - where(internal_attributes.map { |attr| "#{attr} IS NOT TRUE" }.join(" AND ")) + where('ghost IS NOT TRUE') end #