Merge 14059:14394 from trunk.
[rails.git] / app / models / acl.rb
1 class Acl < ActiveRecord::Base
2   def self.find_by_address(address, options)
3     self.with_scope(:find => {:conditions => ["inet_aton(?) & netmask = address", address]}) do
4       return self.find(:first, options)
5     end
6   end
7
8   def self.find_all_by_address(address, options)
9     self.with_scope(:find => {:conditions => ["inet_aton(?) & netmask = address", address]}) do
10       return self.find(:all, options)
11     end
12   end
13 end