<commit_before>class ApplicationController < ActionController::Base
  include Clearance::Controller
  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception

  before_action :load_tags

  decorates_assigned :categories

  def admin_controller?
    false
  end
  helper_method :admin_controller?

  def load_tags
    @all_tags ||= Post.all_tags.sort_by { |tag| Post::PRIMARY_TAGS.include?(tag.name.to_sym) ? 0 : 1 }.first(10)
  end
end<commit_msg>Shows only published tags<commit_after>class ApplicationController < ActionController::Base
  include Clearance::Controller
  # Prevent CSRF attacks by raising an exception.
  # For APIs, you may want to use :null_session instead.
  protect_from_forgery with: :exception

  before_action :load_tags

  decorates_assigned :categories

  def admin_controller?
    false
  end
  helper_method :admin_controller?

  def load_tags
    @all_tags ||= Post.all_tags
      .select  { |tag| Post.published.tagged_with(tag).any? }
      .sort_by { |tag| Post::PRIMARY_TAGS.include?(tag.name.to_sym) ? 0 : 1 }.first(10)
  end
end
{'fraction_non_alphanumeric': 0.08586296617519515, 'fraction_numerical': 0.006938421509106678, 'mean_word_length': 4.417840375586854, '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': '2545265', 'n_tokens_mistral': 382, 'n_tokens_neox': 362, 'n_words': 96}