<commit_before>require_relative "../persistence/sqlite_adaptor"

class Repository
  def initialize(args = {})
    @database = args.fetch(:db) { SQLiteAdaptor.database }
  end

  def save_following(user_id)
    following_table.insert(
      user_id:    user_id,
      created_at: Time.now,
    )
  end

  def following_after(days)
    following_table.where(Sequel[:created_at] < Time.at(time_before(days))).map(:user_id)
  end

  def following
    following_table.map(:user_id)
  end

  private

  attr_reader :database

  def following_table
    database[:following]
  end

  def time_before(number_days)
    Time.now.to_i - 86400 * number_days + 300
  end
end<commit_msg>Query where the following is created (not before)<commit_after>require_relative "../persistence/sqlite_adaptor"

class Repository
  def initialize(args = {})
    @database = args.fetch(:db) { SQLiteAdaptor.database }
  end

  def save_following(user_id)
    following_table.insert(
      user_id:    user_id,
      created_at: Time.now,
    )
  end

  def following_after(days)
    following_table.where(created_at: Time.at(time_before(days))..Time.at(time_before(days) + 300)).map(:user_id)
  end

  def following
    following_table.map(:user_id)
  end

  private

  attr_reader :database

  def following_table
    database[:following]
  end

  def time_before(number_days)
    Time.now.to_i - 86400 * number_days
  end
end
{'fraction_non_alphanumeric': 0.09871244635193133, 'fraction_numerical': 0.011444921316165951, 'mean_word_length': 3.6633333333333336, 'pattern_counts': {'":': 0, '<': 4, '<?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': '4795729', 'n_tokens_mistral': 501, 'n_tokens_neox': 470, 'n_words': 90}