Fix Rails/WhereExists
cop in User model (#28792)
This commit is contained in:
parent
81e4e65610
commit
9fb9ef418a
2 changed files with 1 additions and 2 deletions
|
@ -434,7 +434,7 @@ class User < ApplicationRecord
|
|||
end
|
||||
|
||||
def sign_up_from_ip_requires_approval?
|
||||
!sign_up_ip.nil? && IpBlock.where(severity: :sign_up_requires_approval).where('ip >>= ?', sign_up_ip.to_s).exists?
|
||||
sign_up_ip.present? && IpBlock.sign_up_requires_approval.exists?(['ip >>= ?', sign_up_ip.to_s])
|
||||
end
|
||||
|
||||
def sign_up_email_requires_approval?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue