<commit_before>class FitterHappierController < ActionController::Base
  session :off
  layout nil

  def index
    render :text => 'Hai!' and return
  end
  
  private
  
  def process_with_silence(*args)
    logger.silence do
      process_without_silence(*args)
    end
  end
 
  alias_method_chain :process, :silence
end<commit_msg>Adding a database check which is compatible with all versions of rails<commit_after>class FitterHappierController < ActionController::Base
  session :off
  layout nil
  
  def index
    table_name = (Rails::VERSION::STRING >= '2.1.0' ? 'schema_migrations' : 'schema_info')
    query      = "SELECT version FROM #{table_name} ORDER BY version DESC LIMIT 1"
    version    = ActiveRecord::Base.connection.select_value(query)
    time       = Time.now.to_formatted_s(:rfc822)
    render(:text => "Mongrel and Database Check Passed @ #{time} -- Schema Version: #{version}")
  end
  
  private
  
  def process_with_silence(*args)
    logger.silence do
      process_without_silence(*args)
    end
  end
 
  alias_method_chain :process, :silence
end
{'fraction_non_alphanumeric': 0.08804448563484708, 'fraction_numerical': 0.006487488415199258, 'mean_word_length': 3.6956521739130435, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '4032603', 'n_tokens_mistral': 345, 'n_tokens_neox': 337, 'n_words': 89}