<commit_before>class ProjectSerializer < ApplicationSerializer
  has_many :goals
  has_many :municipalities
  has_many :subregions

  # attribute :image do
  #   object.image_small
  # end
  attribute :title do
    object.new_name
  end
  attribute :description do
    object.new_ShortDescription.force_encoding(Encoding::UTF_8)
  end
  attribute :location do
    object.new_geoexplain
  end
  attribute :primary_department do
    object.department_name
  end
  attribute :project_manager do
    object.manager_name
  end
  attribute :website do
    object.new_Website
  end
  attribute :status do
    object.status
  end
  attribute :number do
    object.new_count
  end

  def links
    {
      :self => "/#{type}/#{id}",
      :next => object.next ? "/#{type}/#{object.next.id}" : nil,
      :prev => object.prev ? "/#{type}/#{object.prev.id}" : nil
    }
  end
end<commit_msg>Add image methods back into serializer<commit_after>class ProjectSerializer < ApplicationSerializer
  has_many :goals
  has_many :municipalities
  has_many :subregions

  attribute :image do
    if context[:is_collection]
      object.image_small
    else
      object.image_full
    end
  end
  attribute :title do
    object.new_name
  end
  attribute :description do
    object.new_ShortDescription
  end
  attribute :location do
    object.new_geoexplain
  end
  attribute :primary_department do
    object.department_name
  end
  attribute :project_manager do
    object.manager_name
  end
  attribute :website do
    object.new_Website
  end
  attribute :status do
    object.status
  end
  attribute :number do
    object.new_count
  end

  def links
    {
      :self => "/#{type}/#{id}",
      :next => object.next ? "/#{type}/#{object.next.id}" : nil,
      :prev => object.prev ? "/#{type}/#{object.prev.id}" : nil
    }
  end
end
{'fraction_non_alphanumeric': 0.09225700164744646, 'fraction_numerical': 0.0005491488193300384, 'mean_word_length': 3.0309734513274336, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '6871619', 'n_tokens_mistral': 584, 'n_tokens_neox': 579, 'n_words': 145}