<commit_before># frozen_string_literal: true
#=Controller for the Revisions API.
class RevisionsController < ApplicationController
  respond_to :json
  DEFAULT_REVISION_LIMIT = 10

  # Returns revisions for a single user within the scope of a single course.
  def index
    user = User.find(params[:user_id])
    course = Course.find(params[:course_id])

    @revisions = course.revisions.where(user_id: user.id)
                       .order('revisions.created_at DESC')<commit_msg>Order recent user revisions by date, not created_at<commit_after># frozen_string_literal: true
#=Controller for the Revisions API.
class RevisionsController < ApplicationController
  respond_to :json
  DEFAULT_REVISION_LIMIT = 10

  # Returns revisions for a single user within the scope of a single course.
  def index
    user = User.find(params[:user_id])
    course = Course.find(params[:course_id])

    @revisions = course.revisions.where(user_id: user.id)
                       .order('revisions.date DESC')
{'fraction_non_alphanumeric': 0.08316633266533066, 'fraction_numerical': 0.004008016032064128, 'mean_word_length': 3.8970588235294117, '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': '3002026', 'n_tokens_mistral': 303, 'n_tokens_neox': 282, 'n_words': 84}