<commit_before>module Api
  module V1
    class ApplianceTypesController < ApplicationController
      load_and_authorize_resource :appliance_type
      respond_to :json

      def index
        respond_with @appliance_types
      end

      def show
        respond_with @appliance_type
      end

      def create
        if @appliance_type.save
          render json: @appliance_type, serializer: ApplianceTypeSerializer
        else
          render_error
        end
      end

      def update
        if @appliance_type.update_attributes(appliance_type_params)
          render json: @appliance_type, serializer: ApplianceTypeSerializer
        else
          render_error
        end
      end

      def destroy
        if @appliance_type.destroy
          render json: {}
        else
          render_error<commit_msg>created (201) when AT is created<commit_after>module Api
  module V1
    class ApplianceTypesController < ApplicationController
      load_and_authorize_resource :appliance_type
      respond_to :json

      def index
        respond_with @appliance_types
      end

      def show
        respond_with @appliance_type
      end

      def create
        if @appliance_type.save
          render json: @appliance_type, serializer: ApplianceTypeSerializer, status: :created
        else
          render_error
        end
      end

      def update
        if @appliance_type.update_attributes(appliance_type_params)
          render json: @appliance_type, serializer: ApplianceTypeSerializer
        else
          render_error
        end
      end

      def destroy
        if @appliance_type.destroy
          render json: {}
        else
          render_error
{'fraction_non_alphanumeric': 0.03480825958702065, 'fraction_numerical': 0.0029498525073746312, 'mean_word_length': 2.0285714285714285, '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': '1686954', 'n_tokens_mistral': 471, 'n_tokens_neox': 436, 'n_words': 116}