<commit_before>module CommunitiesHelper
  def render_community(community)
    link_to(community.name, community)
  end

  def render_category(community)
    h community.category
  end

  def render_location(community, area=nil)
    if area.nil?
      location = [:city, :prov_state, :country].inject([]) { |l, f| l << community.send(f) }
      location.reject{|i| i.blank?}.join(', ')
    else
      h truncate(community.send(area), :length => 15)
    end
  end

  def render_scope(community, length = 20)
    h truncate(community.scope, length)
  end

  def render_websites_count(community)
    number_with_delimiter(community.n_websites)
  end


  def render_community_actions(community)
    return unless current_user

    text = ''
    if current_user.permission >= 4.0
      text << content_tag(:span, link_to('Edit', edit_community_path(community)), :class => 'permission')
    end

    if current_user.permission >= 7.0
      text << ' '
      text << content_tag(:span, link_to('Destroy', community, :confirm => 'Are you sure?', :method => :delete), :class => 'permission')
    end
<commit_msg>Fixed deprecation warning.<commit_after>module CommunitiesHelper
  def render_community(community)
    link_to(community.name, community)
  end

  def render_category(community)
    h community.category
  end

  def render_location(community, area=nil)
    if area.nil?
      location = [:city, :prov_state, :country].inject([]) { |l, f| l << community.send(f) }
      location.reject{|i| i.blank?}.join(', ')
    else
      h truncate(community.send(area), :length => 15)
    end
  end

  def render_scope(community, length = 20)
    h truncate(community.scope, :length => length)
  end

  def render_websites_count(community)
    number_with_delimiter(community.n_websites)
  end


  def render_community_actions(community)
    return unless current_user

    text = ''
    if current_user.permission >= 4.0
      text << content_tag(:span, link_to('Edit', edit_community_path(community)), :class => 'permission')
    end

    if current_user.permission >= 7.0
      text << ' '
      text << content_tag(:span, link_to('Destroy', community, :confirm => 'Are you sure?', :method => :delete), :class => 'permission')
    end

{'fraction_non_alphanumeric': 0.12836624775583483, 'fraction_numerical': 0.00718132854578097, 'mean_word_length': 3.7425531914893617, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 18, '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': '4491447', 'n_tokens_mistral': 748, 'n_tokens_neox': 684, 'n_words': 161}