<commit_before>class User < ActiveRecord::Base
  has_secure_password
  
  has_many :reviews
  has_many :user_venues
  has_many :favorites, through: :user_venues, source: :venue

  validates :user_name, :email, :password, presence: true
  validates :email, uniqueness: true

  def has_favorited?(venue)
  	self.favorites.include?(venue)
  end
end<commit_msg>add has_favorites? method to user model<commit_after>class User < ActiveRecord::Base
  has_secure_password
  
  has_many :reviews
  has_many :user_venues
  has_many :favorites, through: :user_venues, source: :venue
  has_many :user_events
  has_many :events, through: :user_events

  validates :user_name, :email, :password, presence: true
  validates :email, uniqueness: true

  def has_favorited?(venue)
  	self.favorites.include?(venue)
  end

  def has_favorites?
  	!self.favorites.empty?
  end
  
end
{'fraction_non_alphanumeric': 0.08922363847045191, 'fraction_numerical': 0.0, 'mean_word_length': 5.041958041958042, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7193444', 'n_tokens_mistral': 309, 'n_tokens_neox': 305, 'n_words': 72}