<commit_before>class RecipeDecorator < ApplicationDecorator
  delegate_all

  def formatted_created_at
    created_at.strftime("%d/%m/%Y")
  end

  def preparation_time
    "#{time.hour}:#{time.min}"
  end

  def average_review
    reviews.average(:rating).to_f.round(2) if reviews.present?
  end

  def counts_review
    "(#{reviews_count})".strip if reviews.present?
  end

  def edit_link
    h.link_to("Edit", h.edit_recipe_path(object)).html_safe if user == h.current_user
  end
end<commit_msg>update reviews_average method in Recipe Decorator<commit_after>class RecipeDecorator < ApplicationDecorator
  delegate_all

  def formatted_created_at
    created_at.strftime("%d/%m/%Y")
  end

  def preparation_time
    "#{time.hour}:#{time.min}"
  end

  def average_review
    reviews_average.to_f.round(2) if reviews.present?
  end

  def counts_review
    "(#{reviews_count})".strip if reviews.present?
  end

  def edit_link
    h.link_to("Edit", h.edit_recipe_path(object)).html_safe if user == h.current_user
  end
end
{'fraction_non_alphanumeric': 0.10926829268292683, 'fraction_numerical': 0.001951219512195122, 'mean_word_length': 4.208121827411167, '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': '953310', 'n_tokens_mistral': 366, 'n_tokens_neox': 356, 'n_words': 70}