<commit_before>class InterrogatorController < ApplicationController
  def show
    param_class = (params[:klass] || 'Complaint').camelize(:upper)
    klass = param_class.constantize 
    respond_to do |format|
      format.js { render :json => [
        {
          :columns => klass.simple_columns_array,
          :associations => klass.associated_models_hash
        }
      ]}
    end
  end
end<commit_msg>return details via json query, return conditions via js query<commit_after>class InterrogatorController < ApplicationController
  def show
    respond_to do |format|
      format.json do
        param_class = params[:klass].to_s.camelize(:upper)
        details = {}
        if param_class.present?
          klass = param_class.constantize
          details[:columns] = klass.simple_columns_array
          details[:associations] = klass.associated_models_hash
        end
        render :json => details
      end
      format.js do
        query_options = []
        query_options.tap do |arr|
          Interrogator::Conditions.constants.each do |konstant|
            arr << Interrogator::Conditions.const_get(konstant.to_sym)
          end
        end
        render :json => query_options
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.0827250608272506, 'fraction_numerical': 0.0, 'mean_word_length': 2.446927374301676, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, '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': '1875059', 'n_tokens_mistral': 342, 'n_tokens_neox': 344, 'n_words': 77}