Simplify ip_service
This commit is contained in:
parent
fc8cebd78d
commit
b7f8bb2fea
2 changed files with 13 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue