<commit_before>module Api
	module V1
		class TechniciansController < ApplicationController
			respond_to :json
		end
	end
end<commit_msg>Add API version for TechniciansController<commit_after>module Api
	module V1
		class TechniciansController < ApiApplicationController
            before_action :set_technician, only: [ :technician_location ]
			def index
                respond_with Technician.all
            end

            def show
                respond_with Technician.find(params[:id])
            end

            def create
                respond_with Technician.create(technician_params)
            end

            def update
                respond_with Technician.update(params[:id],location_params)
            end

            def destroy
                respond_with Technician.destroy(params[:id])
            end

            def technician_location
                if @technician.location != nil
                    respond_with @technician.location.to_json(only: [:id, :lat , :long] ) , status: :ok
                else
                    respond_with @technician.errors, status: :not_found
                end
            end

            private
                # Use callbacks to share common setup or constraints between actions.
                def set_technician
                    begin
                      @technician = Technician.find(params[:id])
                    rescue ActiveRecord::RecordNotFound
                        respond_with @technician , status: :not_found
                    end
                end
                # Never trust parameters from the scary internet, only allow the white list through.
                def technician_params
                  params.require(:technician).permit(:name, :email, :password, :gcm_id, location_attributes: [:lat , :long])
                end
		end
	end
end
{'fraction_non_alphanumeric': 0.05549568965517242, 'fraction_numerical': 0.0010775862068965517, 'mean_word_length': 1.5972027972027971, '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': '7051873', 'n_tokens_mistral': 453, 'n_tokens_neox': 418, 'n_words': 120}