1 # == Schema Information
5 # id :integer not null, primary key
16 class Acl < ActiveRecord::Base
17 validates :k, :presence => true
19 def self.match(address, domain = nil)
21 Acl.where("address >>= ? OR domain = ?", address, domain)
23 Acl.where("address >>= ?", address)
27 def self.no_account_creation(address, domain = nil)
28 match(address, domain).where(:k => "no_account_creation").exists?
31 def self.no_note_comment(address, domain = nil)
32 match(address, domain).where(:k => "no_note_comment").exists?
35 def self.no_trace_download(address, domain = nil)
36 match(address, domain).where(:k => "no_trace_download").exists?