<commit_before>class TelephoneNumbersController < ApplicationController
  
  before_filter :login_required

  # GET /telephone_numbers
  # GET /telephone_numbers.xml
  def index
#    @contacts = Contact.find(:all)
    @contacts = session[:user].contacts
    
    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @contacts }
    end
  end

end
<commit_msg>Got telephone number saves to work with poylmorphic routes<commit_after>class TelephoneNumbersController < ApplicationController
  
  before_filter :login_required

  # GET /contacts/1/telephone_numbers/1/edit
  def edit
    @contact = Contact.find_by_id_and_user_id(params[:contact_id], session[:user].id)
    @telno = TelephoneNumber.find_by_id_and_contact_id(params[:id], params[:contact_id])
  end

  # PUT /contacts/1
  # PUT /contacts/1.xml
  def update
    @contact = Contact.find_by_id_and_user_id(params[:contact_id], session[:user].id)
    @telno = TelephoneNumber.find_by_id_and_contact_id(params[:id], params[:contact_id])

    respond_to do |format|
      if @telno.update_attributes(params[:telephone_number])
        flash[:notice] = 'Telephone Number was successfully updated.'
        format.html { redirect_to(@contact, :action=>:edit) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @contact.errors, :status => :unprocessable_entity }
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.10648464163822526, 'fraction_numerical': 0.0027303754266211604, 'mean_word_length': 3.698717948717949, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 7}, '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': '7479228', 'n_tokens_mistral': 481, 'n_tokens_neox': 466, 'n_words': 95}