<commit_before>class DatasetsController < ApplicationController
  load_and_authorize_resource
  skip_authorize_resource :only => :show

  before_filter :authenticate_user!, only: :dashboard
  before_filter :authenticate_user_from_token!, only: [:create, :update_certificate, :import_status]
  before_filter(:only => [:show, :index]) { alternate_formats [:feed, :json] }
  before_filter :jurisdiction_required, only: :create
  before_filter :dataset_information_required, only: :create
  before_filter :no_published_certificate_exists, only: :create

  before_filter :clean_params, only: :index

  def info
    respond_to do |format|
      format.json do
        render json: {
          published_certificate_count: Dataset.published_count
        }
      end
    end
  end

  def index

    datasets = Dataset
                .visible
                .includes(:response_set, :certificate)
                .order('certificates.published_at DESC')

    @title = t('datasets.datasets')<commit_msg>dont include unpublished certs in dataset browsing action<commit_after>class DatasetsController < ApplicationController
  load_and_authorize_resource
  skip_authorize_resource :only => :show

  before_filter :authenticate_user!, only: :dashboard
  before_filter :authenticate_user_from_token!, only: [:create, :update_certificate, :import_status]
  before_filter(:only => [:show, :index]) { alternate_formats [:feed, :json] }
  before_filter :jurisdiction_required, only: :create
  before_filter :dataset_information_required, only: :create
  before_filter :no_published_certificate_exists, only: :create

  before_filter :clean_params, only: :index

  def info
    respond_to do |format|
      format.json do
        render json: {
          published_certificate_count: Dataset.published_count
        }
      end
    end
  end

  def index

    datasets = Dataset.visible
                .includes(:response_set)
                .joins(:certificate).where('certificates.published = true')
                .order('certificates.published_at DESC')

    @title = t('datasets.datasets')
{'fraction_non_alphanumeric': 0.086977414704469, 'fraction_numerical': 0.0, 'mean_word_length': 3.7972350230414746, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '1870037', 'n_tokens_mistral': 620, 'n_tokens_neox': 593, 'n_words': 134}