<commit_before>class Acl < ActiveRecord::Base
  def self.find_by_address(address, options)
    self.with_scope(:find => {:conditions => ["inet_aton(?) & netmask = address", address]}) do
      return self.find(:first, options)
    end
  end

  def self.find_all_by_address(address, options)
    self.with_scope(:find => {:conditions => ["inet_aton(?) & netmask = address", address]}) do
      return self.find(:all, options)
    end
  end
end<commit_msg>Cope with MySQL and Postgres.<commit_after>class Acl < ActiveRecord::Base
  def self.find_by_address(address, options)
    self.with_scope(:find => {:conditions => ["#{inet_aton} & netmask = address", address]}) do
      return self.find(:first, options)
    end
  end

  def self.find_all_by_address(address, options)
    self.with_scope(:find => {:conditions => ["#{inet_aton} & netmask = address", address]}) do
      return self.find(:all, options)
    end
  end

private

  def self.inet_aton
    if self.connection.adapter_name == "MySQL"
      "inet_aton(?)"
    else
      "?"
    end
  end
end
{'fraction_non_alphanumeric': 0.14015151515151514, 'fraction_numerical': 0.0, 'mean_word_length': 3.7828054298642533, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '869228', 'n_tokens_mistral': 347, 'n_tokens_neox': 338, 'n_words': 81}