X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/fd6f00b069af5a7b87227ea4c3401dc461d7311a..7e267d4a0dde9c01caedcdc5e853ace5e56361dc:/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