Fix up case statement syntax for ruby 1.9 compatibility
[rails.git] / app / models / acl.rb
1 class Acl < ActiveRecord::Base
2   scope :address, lambda { |address| where("#{inet_aton} & netmask = address", address) }
3
4 private
5
6   def self.inet_aton
7     if self.connection.adapter_name == "MySQL"
8       "inet_aton(?)"
9     else
10       "?"
11     end
12   end
13 end