+# == Schema Information
+#
+# Table name: acls
+#
+# id :bigint(8) not null, primary key
+# address :inet
+# k :string not null
+# v :string
+# domain :string
+#
+# Indexes
+#
+# acls_k_idx (k)
+# index_acls_on_address (address) USING gist
+# index_acls_on_domain (domain)
+#
+
class Acl < ActiveRecord::Base
+ validates :k, :presence => true
+
def self.match(address, domain = nil)
if domain
Acl.where("address >>= ? OR domain = ?", address, domain)