<commit_before>class Event < ActiveRecord::Base
  has_many :event_wines
  has_many :wine_bringers, through: :event_wines
  has_many :wines, through: :event_wines

  belongs_to :creator, class_name: "User", foreign_key: "user_id"

  validates :name, presence: true
  validates :location, presence: true
  validates :date, presence: true
  validates :time, presence: true

  # return array of user objs
  # update to reflect is_attending col on event_wines
  def attending_users
    self.wine_bringers
  end

  def winelist
    self.wines
  end
end<commit_msg>Add conditional to accurately reflect attending guests<commit_after>class Event < ActiveRecord::Base
  has_many :event_wines
  has_many :wine_bringers, through: :event_wines
  has_many :wines, through: :event_wines

  belongs_to :creator, class_name: "User", foreign_key: "user_id"

  validates :name, presence: true
  validates :location, presence: true
  validates :date, presence: true
  validates :time, presence: true

  # return array of user objs
  # update to reflect is_attending col on event_wines
  def attending_users
    attending =[]
    invites = self.event_wines
    invites.each do |invite|
      if invite.is_attending == true
        attending << invite.wine_bringer
      end
    end
    attending
  end

  def winelist
    self.wines
  end
end
{'fraction_non_alphanumeric': 0.07034795763993948, 'fraction_numerical': 0.0, 'mean_word_length': 4.030418250950571, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3993860', 'n_tokens_mistral': 439, 'n_tokens_neox': 424, 'n_words': 130}