<commit_before>class Trip < ActiveRecord::Base
  has_many :hitchhikes, :dependent => :destroy
  belongs_to :user
  
  validates :from, :presence => true
  validates :to, :presence => true
  validates :distance, :numericality => true
  validates :user_id, :presence => true
  
  concerned_with :googlemaps

  attr_accessor :rides

  before_save do
    # build as much hitchhikes on top of the ride as previously defined
    rides.to_i.times{ hitchhikes.build }
  end

  def to_s
    "#{date.strftime("%d %b %Y")}: #{from} -> #{to}"
  end
end<commit_msg>trip fix<commit_after>class Trip < ActiveRecord::Base
  has_many :hitchhikes, :dependent => :destroy
  belongs_to :user
  
  validates :from, :presence => true
  validates :to, :presence => true
  validates :distance, :numericality => true
  validates :user_id, :presence => true
  
  concerned_with :googlemaps

  attr_accessor :rides

  before_save do
    # build as much hitchhikes on top of the ride as previously defined
    rides.to_i.times{ hitchhikes.build }
  end

  def to_s
    ["#{date.strftime("%d %b %Y")}: ", from, " -> ", to].compact.join
  end
end
{'fraction_non_alphanumeric': 0.11559139784946236, 'fraction_numerical': 0.0, 'mean_word_length': 3.7939914163090127, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '1731058', 'n_tokens_mistral': 394, 'n_tokens_neox': 385, 'n_words': 110}