<commit_before>class DrawingDecorator < Draper::Decorator
  delegate_all
  decorates_association :user

  def self.collection_decorator_class
    PaginatingDecorator
  end

  def description_concat
    text_concat(object.description)
  end

  def story_concat
    text_concat(object.story)
  end

  private

  def text_concat(text, max_length=30)
    text[0, max_length - 1].concat('...')
  end
end<commit_msg>Hot-fix for error on null description/stories when trying to concat<commit_after>class DrawingDecorator < Draper::Decorator
  delegate_all
  decorates_association :user

  def self.collection_decorator_class
    PaginatingDecorator
  end

  def description_concat
    text_concat(object.description) unless object.description.nil?
  end

  def story_concat
    text_concat(object.story) unless object.story.nil?
  end

  private

  def text_concat(text, max_length=30)
    text[0, max_length - 1].concat('...')
  end
end
{'fraction_non_alphanumeric': 0.07311827956989247, 'fraction_numerical': 0.008602150537634409, 'mean_word_length': 4.230337078651686, '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': '6869260', 'n_tokens_mistral': 314, 'n_tokens_neox': 297, 'n_words': 66}