<commit_before>class OldRelationController < ApplicationController
  require 'xml/libxml'

  session :off
  before_filter :check_api_readable
  after_filter :compress_output

  def history
    begin
      relation = Relation.find(params[:id])
      doc = OSM::API.new.get_xml_doc

      relation.old_relations.each do |old_relation|
        doc.root << old_relation.to_xml_node
      end

      render :text => doc.to_s, :content_type => "text/xml"
    rescue ActiveRecord::RecordNotFound
      render :nothing => true, :status => :not_found
    rescue
      render :nothing => true, :status => :internal_server_error
    end
  end
  
  def version
    begin
      old_relation = OldRelation.find(:first, :conditions => {:id => params[:id], :version => params[:version]} )
      
      response.headers['Last-Modified'] = old_relation.timestamp.rfc822

      doc = OSM::API.new.get_xml_doc
      doc.root << old_relation.to_xml_node

      render :text => doc.to_s, :content_type => "text/xml"
    rescue ActiveRecord::RecordNotFound
      render :nothing => true, :status => :not_found
    rescue
      render :nothing => true, :status => :internetal_service_error
    end
  end
end<commit_msg>Apply patch by Lars from osm dev list with the typo<commit_after>class OldRelationController < ApplicationController
  require 'xml/libxml'

  session :off
  before_filter :check_api_readable
  after_filter :compress_output

  def history
    begin
      relation = Relation.find(params[:id])
      doc = OSM::API.new.get_xml_doc

      relation.old_relations.each do |old_relation|
        doc.root << old_relation.to_xml_node
      end

      render :text => doc.to_s, :content_type => "text/xml"
    rescue ActiveRecord::RecordNotFound
      render :nothing => true, :status => :not_found
    rescue
      render :nothing => true, :status => :internal_server_error
    end
  end
  
  def version
    begin
      old_relation = OldRelation.find(:first, :conditions => {:id => params[:id], :version => params[:version]} )
      
      response.headers['Last-Modified'] = old_relation.timestamp.rfc822

      doc = OSM::API.new.get_xml_doc
      doc.root << old_relation.to_xml_node

      render :text => doc.to_s, :content_type => "text/xml"
    rescue ActiveRecord::RecordNotFound
      render :nothing => true, :status => :not_found
    rescue
      render :nothing => true, :status => :internal_service_error
    end
  end
end
{'fraction_non_alphanumeric': 0.10717230008244023, 'fraction_numerical': 0.00247320692497939, 'mean_word_length': 3.235602094240838, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 16}, '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': '5514660', 'n_tokens_mistral': 759, 'n_tokens_neox': 736, 'n_words': 171}