<commit_before>module Tlab
  class Post < ActiveRecord::Base
    extend FriendlyId
    friendly_id :title, use: :history

    belongs_to :author
    validates :slug, presence: true
    attr_accessor :author_name
    belongs_to :author, class_name: Tlab.author_class

    def next
      future_posts.first
    end

    def prev
      past_posts.first
    end

    private
    def future_posts
      Tlab::Post.where("published_at > ?", [published_at]).order("published_at asc")
    end

    def past_posts
      Tlab::Post.where("published_at < ?", [published_at]).order("published_at desc")
    end
  end
end<commit_msg>most_recent scope that shows last 3 published<commit_after>module Tlab
  class Post < ActiveRecord::Base
    extend FriendlyId
    friendly_id :title, use: :history

    belongs_to :author
    validates :slug, presence: true
    attr_accessor :author_name
    belongs_to :author, class_name: Tlab.author_class

    scope :most_recent, -> { order("published_at desc").first(3) }

    def next
      future_posts.first
    end

    def prev
      past_posts.first
    end

    private
    def future_posts
      Tlab::Post.where("published_at > ?", [published_at]).order("published_at asc")
    end

    def past_posts
      Tlab::Post.where("published_at < ?", [published_at]).order("published_at desc")
    end
  end
end
{'fraction_non_alphanumeric': 0.09179104477611941, 'fraction_numerical': 0.0014925373134328358, 'mean_word_length': 3.177570093457944, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 6, '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': '2846787', 'n_tokens_mistral': 427, 'n_tokens_neox': 418, 'n_words': 101}