<commit_before>class PostsController < ApplicationController
  before_filter :require_login, :except => ["index", "show", "rss"]

  def index
    @posts = Post.find_tagged_with(params[:tag]).reverse if params[:tag]
    @posts = Post.all.reverse.paginate :page => params[:page] unless @posts
  end
  
  def show
    @post = Post.find(params[:id])
  end
  
  def new
    @post = Post.new
  end
  
  def create<commit_msg>fixing pagination bug with tags<commit_after>class PostsController < ApplicationController
  before_filter :require_login, :except => ["index", "show", "rss"]

  def index
    @posts = Post.find_tagged_with(params[:tag]).reverse.paginate :page => params[:page] if params[:tag]
    @posts = Post.all.reverse.paginate :page => params[:page] unless @posts
  end
  
  def show
    @post = Post.find(params[:id])
  end
  
  def new
    @post = Post.new
  end
  
  def create
{'fraction_non_alphanumeric': 0.12950450450450451, 'fraction_numerical': 0.0, 'mean_word_length': 3.7540106951871657, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '505156', 'n_tokens_mistral': 291, 'n_tokens_neox': 284, 'n_words': 73}