Simplify ip_service

This commit is contained in:
simon lehericey 2019-08-01 15:34:33 +02:00
parent fc8cebd78d
commit b7f8bb2fea
2 changed files with 13 additions and 7 deletions

View file

@ -3,13 +3,7 @@ class IPService
def ip_trusted?(ip)
ip_address = parse_address(ip)
if ip_address.nil?
false
elsif trusted_networks.present?
trusted_networks.any? { |network| network.include?(ip_address) }
else
false
end
trusted_networks.any? { |network| network.include?(ip_address) }
end
private