<commit_before>module NotificationsHelper

  # An activity object title
  def title_of(act_obj)
    if act_obj.is_a? Comment
      'Re: ' + title_of(act_obj.parent_post)
    elsif act_obj.is_a? Post and (not act_obj.text.nil?)
      act_obj.text.truncate(30, :separator => ' ')
    elsif act_obj.respond_to? :title and (not act_obj.title.nil?)
      act_obj.title.truncate(30, :separator => ' ')
    elsif act_obj.respond_to? :url and (not act_obj.url.nil?)
      act_obj.url.truncate(30, :separator => ' ')
    else I18n.t('notification.default')
    end
  end

  # An activity object description
  def description_of(act_obj)
    if act_obj.respond_to? :text and (not act_obj.text.nil?)
      sanitize(act_obj.text.truncate(100, :separator =>' '))
    elsif act_obj.respond_to? :description and (not act_obj.description.nil?)
      sanitize(act_obj.description.truncate(100, :separator =>' '))
    else
      I18n.t('notification.watch_it')
    end
  end

  # Set locale as per subject preference
  def locale_as(subject)
    if subject.respond_to? :language
      I18n.locale = subject.language || I18n.default_locale
    end
  end

end<commit_msg>Do not truncate notification's description<commit_after>module NotificationsHelper

  # An activity object title
  def title_of(act_obj)
    if act_obj.is_a? Comment
      'Re: ' + title_of(act_obj.parent_post)
    elsif act_obj.is_a? Post and (not act_obj.text.nil?)
      act_obj.text.truncate(30, :separator => ' ')
    elsif act_obj.respond_to? :title and (not act_obj.title.nil?)
      act_obj.title.truncate(30, :separator => ' ')
    elsif act_obj.respond_to? :url and (not act_obj.url.nil?)
      act_obj.url.truncate(30, :separator => ' ')
    else I18n.t('notification.default')
    end
  end

  # An activity object description
  def description_of(act_obj)
    if act_obj.respond_to? :text and (not act_obj.text.nil?)
      sanitize(act_obj.text)
    elsif act_obj.respond_to? :description and (not act_obj.description.nil?)
      sanitize(act_obj.description)
    else
      I18n.t('notification.watch_it')
    end
  end

  # Set locale as per subject preference
  def locale_as(subject)
    if subject.respond_to? :language
      I18n.locale = subject.language || I18n.default_locale
    end
  end

end
{'fraction_non_alphanumeric': 0.11160123511248346, 'fraction_numerical': 0.014997794441993825, 'mean_word_length': 3.4557956777996073, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '6874814', 'n_tokens_mistral': 824, 'n_tokens_neox': 786, 'n_words': 169}