I think it's a good idea to try to encapsulate knowledge about the ip_ranges table inside of IpRange.  Change will be in my next pull request.