Make ACLs match when the address is equal
authorTom Hughes <tom@compton.nu>
Sun, 12 Feb 2012 14:53:07 +0000 (14:53 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 12 Feb 2012 14:53:07 +0000 (14:53 +0000)
app/models/acl.rb

index 9938984aa89a3d83cef907430c6288fed3aabe07..2db7fb76522a0342324d235367ae51d0c5932c97 100644 (file)
@@ -1,9 +1,9 @@
 class Acl < ActiveRecord::Base
   def self.match(address, domain = nil)
     if domain
-      condition = Acl.where("address >> ? OR domain = ?", address, domain)
+      condition = Acl.where("address >>= ? OR domain = ?", address, domain)
     else
-      condition = Acl.where("address >> ?", address)
+      condition = Acl.where("address >>= ?", address)
     end
   end