<commit_before>module CargoWiki
  class ArticlesController < ApplicationController
    before_filter :require_login, :except => [:index, :show]
    before_filter :require_admin, :only => [:destroy, :publish]

    def index
      if params[:tag_id]
        @tag = ActsAsTaggableOn::Tag.find(params[:tag_id])
        @articles = Article.published.tagged_with(@tag.name).order('created_at ASC')
        @unpublished_articles = Article.unpublished.tagged_with(@tag.name).order('created_at ASC')
      else
        @articles = Article.published
        @unpublished_articles = Article.unpublished
      end

      respond_to do |format|
        format.html # index.html.erb
        format.json { render json: @articles }
      end
    end

    def show
      @article = Article.published.find(params[:id])
<commit_msg>sorted the articles by update date<commit_after>module CargoWiki
  class ArticlesController < ApplicationController
    before_filter :require_login, :except => [:index, :show]
    before_filter :require_admin, :only => [:destroy, :publish]

    def index
      if params[:tag_id]
        @tag = ActsAsTaggableOn::Tag.find(params[:tag_id])
        @articles = Article.published.tagged_with(@tag.name).order('updated_at DESC')
        @unpublished_articles = Article.unpublished.tagged_with(@tag.name).order('updated_at DESC')
      else
        @articles = Article.published.order('updated_at DESC')
        @unpublished_articles = Article.unpublished
      end

      respond_to do |format|
        format.html # index.html.erb
        format.json { render json: @articles }
      end
    end

    def show
      @article = Article.published.find(params[:id])

{'fraction_non_alphanumeric': 0.10931899641577061, 'fraction_numerical': 0.0, 'mean_word_length': 3.2297979797979797, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '5556625', 'n_tokens_mistral': 510, 'n_tokens_neox': 483, 'n_words': 102}