<commit_before>class PagesController < ApplicationController

  def create
    if Page.find_by(title: params[:title])
      @page = Page.find_by(title: params[:title])
    else
      wiki_wrapper = WikiWrapper.new
      @page = wiki_wrapper.get_page(params[:query])
    end
    redirect_to page_path(@page)
  end

  def show
    @page = Page.find(params[:id])
    @top_five_authors = @page.top_five_authors
    @revisions = @page.revisions
    gon.anonData = @page.group_anonymous_users_by_location
    gon.anonCountryName = @page.find_country_name
  end
end<commit_msg>fixes page creation bug, at loss of page load speed<commit_after>class PagesController < ApplicationController

  def create
    wiki_wrapper = WikiWrapper.new
    @page = wiki_wrapper.get_page(params[:query])      
    redirect_to page_path(@page)
  end

  def show
    @page = Page.find(params[:id])
    @top_five_authors = @page.top_five_authors
    @revisions = @page.revisions
    gon.anonData = @page.group_anonymous_users_by_location
    gon.anonCountryName = @page.find_country_name
  end
end
{'fraction_non_alphanumeric': 0.09252336448598131, 'fraction_numerical': 0.0, 'mean_word_length': 3.935483870967742, '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': '910914', 'n_tokens_mistral': 365, 'n_tokens_neox': 340, 'n_words': 68}