<commit_before>class FrontPagesController < ApplicationController

  def index
    if logged_in?
      subs  = Subscription.where(user_id: current_user.id).
                           pluck(:subreddit_id).map(&:to_i)

      @post = Post.order(:updated_at).where(subreddit_id: subs).
                                      includes(:subreddit, :user).
                                      paginate(page: params[:page], per_page: 30)
    else
      @posts = Post.order(:updated_at).includes(:subreddit, :user).
                                       paginate(page: params[:page], per_page: 30)
    end

    @votes = Hash.new
    if logged_in?
      user_votes = Vote.where(user_id: current_user.id, comment_id: nil)

      user_votes.each do |vote|
        @votes[vote.post_id] = vote.vote
      end
    end
  end
end<commit_msg>Fixed error effecting logged in users<commit_after>class FrontPagesController < ApplicationController

  def index
    if logged_in?
      subs  = Subscription.where(user_id: current_user.id).
                           pluck(:subreddit_id).map(&:to_i)

      @posts = Post.order(:updated_at).where(subreddit_id: subs).
                                      includes(:subreddit, :user).
                                      paginate(page: params[:page], per_page: 30)
    else
      @posts = Post.order(:updated_at).includes(:subreddit, :user).
                                       paginate(page: params[:page], per_page: 30)
    end

    @votes = Hash.new
    if logged_in?
      user_votes = Vote.where(user_id: current_user.id, comment_id: nil)

      user_votes.each do |vote|
        @votes[vote.post_id] = vote.vote
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.10363311494937463, 'fraction_numerical': 0.004764740917212627, 'mean_word_length': 1.8767123287671232, '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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4029561', 'n_tokens_mistral': 515, 'n_tokens_neox': 500, 'n_words': 98}