Fix `Rails/WhereExists` cop in User model (#28792)
parent
81e4e65610
commit
9fb9ef418a
|
@ -85,7 +85,6 @@ Rails/WhereExists:
|
||||||
- 'app/models/poll.rb'
|
- 'app/models/poll.rb'
|
||||||
- 'app/models/session_activation.rb'
|
- 'app/models/session_activation.rb'
|
||||||
- 'app/models/status.rb'
|
- 'app/models/status.rb'
|
||||||
- 'app/models/user.rb'
|
|
||||||
- 'app/policies/status_policy.rb'
|
- 'app/policies/status_policy.rb'
|
||||||
- 'app/serializers/rest/announcement_serializer.rb'
|
- 'app/serializers/rest/announcement_serializer.rb'
|
||||||
- 'app/serializers/rest/tag_serializer.rb'
|
- 'app/serializers/rest/tag_serializer.rb'
|
||||||
|
|
|
@ -434,7 +434,7 @@ class User < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def sign_up_from_ip_requires_approval?
|
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
|
end
|
||||||
|
|
||||||
def sign_up_email_requires_approval?
|
def sign_up_email_requires_approval?
|
||||||
|
|
Loading…
Reference in New Issue