<commit_before># == Schema Information
#
# Table name: event_categories
#
#  id                              :integer          not null, primary key
#  event_id                        :integer
#  position                        :integer
#  name                            :string(255)
#  created_at                      :datetime
#  updated_at                      :datetime
#  age_range_start                 :integer          default(0)
#  age_range_end                   :integer          default(100)
#  warning_on_registration_summary :boolean          default(FALSE), not null
#
# Indexes
#
#  index_event_categories_event_id              (event_id,position)
#  index_event_categories_on_event_id_and_name  (event_id,name) UNIQUE
#

class EventCategory < ActiveRecord::Base
  belongs_to :event, inverse_of: :event_categories, touch: true, counter_cache: true

  has_many :registrant_event_sign_ups, dependent: :destroy

  has_many :competition_sources, dependent: :destroy

  validates :event, presence: true
  validates :name, {presence: true, uniqueness: {scope: [:event_id]} }

  acts_as_restful_list scope: :event

  def to_s
    event.to_s + " - " + name
  end

  def self.with_warnings
    where(warning_on_registration_summary: true)
  end

  def competitions_being_fed(registrant)
    competition_sources.select{|cs| cs.registrant_passes_filters(registrant) }.map(&:target_competition)
  end

  def signed_up_registrants
    registrant_event_sign_ups.signed_up
  end

  def num_signed_up_registrants
    signed_up_registrants.count
  end

  def age_is_in_range(age)
    return true if age.nil?

    (age_range_start..age_range_end).include?(age)
  end
end
<commit_msg>fix the event_category signed_up_registrants gender exception<commit_after># == Schema Information
#
# Table name: event_categories
#
#  id                              :integer          not null, primary key
#  event_id                        :integer
#  position                        :integer
#  name                            :string(255)
#  created_at                      :datetime
#  updated_at                      :datetime
#  age_range_start                 :integer          default(0)
#  age_range_end                   :integer          default(100)
#  warning_on_registration_summary :boolean          default(FALSE), not null
#
# Indexes
#
#  index_event_categories_event_id              (event_id,position)
#  index_event_categories_on_event_id_and_name  (event_id,name) UNIQUE
#

class EventCategory < ActiveRecord::Base
  belongs_to :event, inverse_of: :event_categories, touch: true, counter_cache: true

  has_many :registrant_event_sign_ups, dependent: :destroy

  has_many :competition_sources, dependent: :destroy

  validates :event, presence: true
  validates :name, {presence: true, uniqueness: {scope: [:event_id]} }

  acts_as_restful_list scope: :event

  def to_s
    event.to_s + " - " + name
  end

  def self.with_warnings
    where(warning_on_registration_summary: true)
  end

  def competitions_being_fed(registrant)
    competition_sources.select{|cs| cs.registrant_passes_filters(registrant) }.map(&:target_competition)
  end

  def signed_up_registrants
    registrant_event_sign_ups.signed_up.map(&:registrant)
  end

  def num_signed_up_registrants
    signed_up_registrants.count
  end

  def age_is_in_range(age)
    return true if age.nil?

    (age_range_start..age_range_end).include?(age)
  end
end

{'fraction_non_alphanumeric': 0.07492711370262391, 'fraction_numerical': 0.004081632653061225, 'mean_word_length': 2.7172264355362947, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3192969', 'n_tokens_mistral': 1096, 'n_tokens_neox': 1053, 'n_words': 215}