<commit_before>require 'active_record'

require_relative 'team'
require_relative 'pick'

class Draft < ActiveRecord::Base
  has_many :teams
  has_many :picks

  def current_pick
    picks.maximum(:number) + 1
  end
end<commit_msg>Fixes bug when there are no picks<commit_after>require 'active_record'

require_relative 'team'
require_relative 'pick'

class Draft < ActiveRecord::Base
  has_many :teams
  has_many :picks

  def current_pick
    (picks.maximum(:number) || 0) + 1
  end
end
{'fraction_non_alphanumeric': 0.08624229979466119, 'fraction_numerical': 0.006160164271047228, 'mean_word_length': 5.0246913580246915, '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': '1405124', 'n_tokens_mistral': 172, 'n_tokens_neox': 163, 'n_words': 44}