X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/bb7c4f93e239c6ff6155b09ffe72a090be3af4f0..afc3a4380cb3097c01e702da072ef70e24aa0888:/app/models/acl.rb?ds=sidebyside diff --git a/app/models/acl.rb b/app/models/acl.rb index 3ff19d35f..94e377343 100644 --- a/app/models/acl.rb +++ b/app/models/acl.rb @@ -1,15 +1,5 @@ class Acl < ActiveRecord::Base - def self.find_by_address(address, options) - self.with_scope(:find => {:conditions => ["#{inet_aton} & netmask = address", address]}) do - return self.find(:first, options) - end - end - - def self.find_all_by_address(address, options) - self.with_scope(:find => {:conditions => ["#{inet_aton} & netmask = address", address]}) do - return self.find(:all, options) - end - end + scope :address, lambda { |address| where("#{inet_aton} & netmask = address", address) } private