]> git.openstreetmap.org Git - rails.git/blob - app/models/acl.rb
Fixed a problem where rails was setting the ID column to null, which violates the...
[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