<commit_before>class Member < ActiveRecord::Base
  has_many :group_members
  has_many :groups, through: :group_members

  scope :active_record_no_participation_in, ->(event) { includes(:groups).references(:groups).where("groups.event_id != ? OR groups.event_id IS NULL", event.id) }
  scope :squeel_no_participation_in, ->(event) { joins{groups.outer}.where{ (groups.event_id != event.id) | (groups.event_id == nil) }.uniq }
  scope :sql_no_participation_in, ->(event) do
    where(<<-SQL, event.id)
NOT EXISTS
    (SELECT * FROM groups b
                JOIN group_members c
                  ON b.id = c.group_id AND
                     b.event_id = ?
              WHERE
                members.id = c.member_id)
    SQL
  end<commit_msg>Add comment.<commit_after>class Member < ActiveRecord::Base
  has_many :group_members
  has_many :groups, through: :group_members

  # FIXME 対応できないパターンがある
  scope :active_record_no_participation_in, ->(event) { includes(:groups).references(:groups).where("groups.event_id != ? OR groups.event_id IS NULL", event.id) }

  # FIXME 対応できないパターンがある
  scope :squeel_no_participation_in, ->(event) { joins{groups.outer}.where{ (groups.event_id != event.id) | (groups.event_id == nil) }.uniq }

  scope :sql_no_participation_in, ->(event) do
    where(<<-SQL, event.id)
NOT EXISTS
    (SELECT * FROM groups b
                JOIN group_members c
                  ON b.id = c.group_id AND
                     b.event_id = ?
              WHERE
                members.id = c.member_id)
    SQL
  end

{'fraction_non_alphanumeric': 0.11929595827900913, 'fraction_numerical': 0.0, 'mean_word_length': 2.7439024390243905, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '3907123', 'n_tokens_mistral': 535, 'n_tokens_neox': 508, 'n_words': 108}