<commit_before># frozen_string_literal: true

module Api
  module Admin
    class ProductSimpleSerializer < ActiveModel::Serializer
      attributes :id, :name, :producer_id

      has_many :variants, key: :variants, serializer: Api::Admin::VariantSimpleSerializer

      def producer_id
        object.supplier_id
      end

      def on_hand
        return 0 if object.on_hand.nil?

        object.on_hand
      end

      def price
        object.price.nil? ? '0.0' : object.price
      end
    end
  end
end<commit_msg>Remove unused methods from ProductSimpleSerializer<commit_after># frozen_string_literal: true

module Api
  module Admin
    class ProductSimpleSerializer < ActiveModel::Serializer
      attributes :id, :name, :producer_id

      has_many :variants, key: :variants, serializer: Api::Admin::VariantSimpleSerializer

      def producer_id
        object.supplier_id
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.06673960612691467, 'fraction_numerical': 0.0032822757111597373, 'mean_word_length': 2.995633187772926, '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': '3310460', 'n_tokens_mistral': 267, 'n_tokens_neox': 262, 'n_words': 71}