<commit_before>class NewMappingSerializer < ActiveModel::Serializer
  embed :ids, include: true
  attributes :id,
             :xloc,
             :yloc,
             :created_at,
             :updated_at
  has_one :user, serializer: NewUserSerializer
  has_one :map, serializer: NewMapSerializer
  has_one :mappable, polymorphic: true ##?

  def filter(keys)
    keys.delete(:xloc) unless object.mappable_type == "Topic"
    keys.delete(:yloc) unless object.mappable_type == "Topic"
    keys
  end
end<commit_msg>just don't include mappable for now<commit_after>class NewMappingSerializer < ActiveModel::Serializer
  embed :ids, include: true
  attributes :id,
             :xloc,
             :yloc,
             :created_at,
             :updated_at,
             :mappable_id,
             :mappable_type

  has_one :user, serializer: NewUserSerializer
  has_one :map, serializer: NewMapSerializer

  def filter(keys)
    keys.delete(:xloc) unless object.mappable_type == "Topic"
    keys.delete(:yloc) unless object.mappable_type == "Topic"
    keys
  end
end
{'fraction_non_alphanumeric': 0.09304511278195489, 'fraction_numerical': 0.0, 'mean_word_length': 2.858695652173913, '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': '964027', 'n_tokens_mistral': 333, 'n_tokens_neox': 325, 'n_words': 78}