<commit_before>class User < ActiveRecord::Base
  has_secure_password

  validates :username, presence: true, uniqueness: true
  validates :password, presence: true
  validates :first_name, presence: true
  validates :last_name, presence: true
  validates :soundcloud_profile, format: { with: /https:\/\/soundcloud\.com\/.*?/ix }
  validates :email_address, presence: true
  validates_format_of :email_address, with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i

  has_many  :ratings

  has_many  :reviews_as_reviewer, class_name: "Review", foreign_key: :reviewer_id
  has_many  :reviews_as_artist, class_name: "Review", foreign_key: :artist_id
  has_many  :comments, foreign_key: :commenter_id

  has_many  :artist_genres, foreign_key: :artist_id
  has_many  :genres, through: :artist_genres, as: :artist

  def full_name
    "#{self.first_name} #{self.last_name}"
  end

  def reviews
    reviews_as_reviewer + reviews_as_artist
  end

end
<commit_msg>allow nil for soundcloud<commit_after>class User < ActiveRecord::Base
  has_secure_password

  validates :username, presence: true, uniqueness: true
  validates :password, presence: true
  validates :first_name, presence: true
  validates :last_name, presence: true
  validates :soundcloud_profile, , allow_nil: true, format: { with: /https:\/\/soundcloud\.com\/.*?/ix }
  validates :email_address, presence: true
  validates_format_of :email_address, with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i

  has_many  :ratings

  has_many  :reviews_as_reviewer, class_name: "Review", foreign_key: :reviewer_id
  has_many  :reviews_as_artist, class_name: "Review", foreign_key: :artist_id
  has_many  :comments, foreign_key: :commenter_id

  has_many  :artist_genres, foreign_key: :artist_id
  has_many  :genres, through: :artist_genres, as: :artist

  def full_name
    "#{self.first_name} #{self.last_name}"
  end

  def reviews
    reviews_as_reviewer + reviews_as_artist
  end

end

{'fraction_non_alphanumeric': 0.12848297213622292, 'fraction_numerical': 0.0030959752321981426, 'mean_word_length': 4.966153846153846, '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': '3347696', 'n_tokens_mistral': 726, 'n_tokens_neox': 711, 'n_words': 153}