So I've converted the IPs to integers using IPAddr, which makes it a
whole lot easier to see if an incoming IP fits a certain range.
The code I'm looking at now is:
@request_ip = IPAddr.new(request.remote_ip)
ips = IpRanges.find(:all)
ips.each do |ip|
range = ip.start_ip_integer..ip.end_ip_integer
@ip_range = ip
render :text => @ip_range.group
Looks painfully slow to iterate thru every row like that - and I keep it
all in my controller when I assume it should be refactored into my
Any way to speed things up?