- def self.find_by_address(address, options)
- self.with_scope(:find => {:conditions => ["#{inet_aton} & netmask = address", address]}) do
- return self.find(:first, options)
+ def self.match(address, domain = nil)
+ if domain
+ Acl.where("address >>= ? OR domain = ?", address, domain)
+ else
+ Acl.where("address >>= ?", address)