Remove User#internal_attributes method
It's not needed anymore as we've replaced boolean `support_bot` with enum `bot_type`.
This commit is contained in:
parent
7457c1e122
commit
a69f889101
1 changed files with 3 additions and 7 deletions
|
@ -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
|
||||
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue