<commit_before>#
# Namespace for the Socializer engine
#
module Socializer
  module People
    #
    # Phones controller
    #
    class PhonesController < ApplicationController
      before_action :authenticate_user

      # POST /people/1/phones
      def create
        @phone = current_user.phones.create!(params[:person_phone])

        redirect_to current_user
      end

      # PATCH/PUT /people/1/phones/1
      def update
        @phone = find_phone
        @phone.update!(params[:person_phone])

        redirect_to current_user
      end

      # DELETE /people/1/phones/1
      def destroy
        @phone = find_phone
        @phone.destroy

        redirect_to current_user
      end

      private

      def find_phone
        current_user.phones.find_by(id: params[:id])
      end<commit_msg>add the phones method<commit_after>#
# Namespace for the Socializer engine
#
module Socializer
  module People
    #
    # Phones controller
    #
    class PhonesController < ApplicationController
      before_action :authenticate_user

      # POST /people/1/phones
      def create
        @phone = phones.create!(params[:person_phone])

        redirect_to current_user
      end

      # PATCH/PUT /people/1/phones/1
      def update
        @phone = find_phone
        @phone.update!(params[:person_phone])

        redirect_to current_user
      end

      # DELETE /people/1/phones/1
      def destroy
        @phone = find_phone
        @phone.destroy

        redirect_to current_user
      end

      private

      def phones
        @phones ||= current_user.phones
      end

      def find_phone
        current_user.phones.find_by(id: params[:id])
      end
{'fraction_non_alphanumeric': 0.07138607971445568, 'fraction_numerical': 0.00594883997620464, 'mean_word_length': 2.086238532110092, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '6956354', 'n_tokens_mistral': 491, 'n_tokens_neox': 469, 'n_words': 111}