<commit_before># == Schema Information
#
# Table name: teamgifs
#
#  id         :integer          not null, primary key
#  gif_id     :integer
#  team_id    :integer
#  votes      :integer
#  created_at :datetime         not null
#  updated_at :datetime         not null
#

class Teamgif < ActiveRecord::Base
  belongs_to :gif
  belongs_to :team
  
  def upvote
    self.votes += 1
    self.save!
  end
  
  def downvote
    self.votes -= 1
    self.save!
  end
  
end<commit_msg>limit votes to max 100 and min 0<commit_after># == Schema Information
#
# Table name: teamgifs
#
#  id         :integer          not null, primary key
#  gif_id     :integer
#  team_id    :integer
#  votes      :integer
#  created_at :datetime         not null
#  updated_at :datetime         not null
#

class Teamgif < ActiveRecord::Base
  belongs_to :gif
  belongs_to :team
  
  def upvote
    unless self.votes == 100
      self.votes += 1
      self.save!
    end
  end
  
  def downvote
    unless self.votes == 0
      self.votes -= 1
      self.save!
    end
  end
  
end
{'fraction_non_alphanumeric': 0.07932011331444759, 'fraction_numerical': 0.0113314447592068, 'mean_word_length': 2.0285714285714285, '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': '1962086', 'n_tokens_mistral': 370, 'n_tokens_neox': 361, 'n_words': 106}