<commit_before>class Application < ActiveRecord::Base
  has_and_belongs_to_many :machines

  attr_accessible :nom, :criticite, :info, :iaw, :pe, :moa, :amoa, :moa_note, :contact, :pnd, :ams, :cerbere, :fiche

  validates_presence_of :nom

  def self.search(search)
    if search
      where("nom LIKE ?", "%#{search}%")
    else
      scoped
    end
  end

  def self.find(*args)
    if args.first && args.first.is_a?(String) && !args.first.match(/^\d*$/)
      application = find_by_nom(*args)
      raise ActiveRecord::RecordNotFound, "Couldn't find Application with identifier=#{args.first}" if application.nil?
      application
    else
      super
    end
  end

  def to_xml(*args)
    super(args.first.reverse_merge(:include => :machines))
  end
end<commit_msg>Do not override ActiveRecord#to_xml method, too many caveats<commit_after>class Application < ActiveRecord::Base
  has_and_belongs_to_many :machines

  attr_accessible :nom, :criticite, :info, :iaw, :pe, :moa, :amoa, :moa_note, :contact, :pnd, :ams, :cerbere, :fiche

  validates_presence_of :nom

  def self.search(search)
    if search
      where("nom LIKE ?", "%#{search}%")
    else
      scoped
    end
  end

  def self.find(*args)
    if args.first && args.first.is_a?(String) && !args.first.match(/^\d*$/)
      application = find_by_nom(*args)
      raise ActiveRecord::RecordNotFound, "Couldn't find Application with identifier=#{args.first}" if application.nil?
      application
    else
      super
    end
  end
end
{'fraction_non_alphanumeric': 0.1314209472981988, 'fraction_numerical': 0.0, 'mean_word_length': 3.6439628482972135, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '7287285', 'n_tokens_mistral': 525, 'n_tokens_neox': 510, 'n_words': 121}