<commit_before>class ConversationsController < ApplicationController
  def show
    @conversation = ConversationGetQuery.execute(params[:id])
    @messages =   MessagesForConversation.execute(@conversation)

    respond_to do |format|
      format.json { render 'conversations/show'  }
      format.html { render_backbone_page }
    end

  end
end<commit_msg>Changed controller to throw 404 when conversation not found<commit_after>class ConversationsController < ApplicationController
  def show
    @conversation = ConversationGetQuery.execute(params[:id])
    @messages     = MessagesForConversationQuery.execute(@conversation) if @conversation

    respond_to do |format|
      format.html { render_backbone_page }
      format.json do 
        if @conversation and @messages.length > 0
          render 'conversations/show'
        else
          render json: [], status: :not_found
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.07227615965480043, 'fraction_numerical': 0.004314994606256742, 'mean_word_length': 3.3773584905660377, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '6881229', 'n_tokens_mistral': 256, 'n_tokens_neox': 246, 'n_words': 62}