<commit_before>class Place < ActiveRecord::Base
  has_many :drops
  validates_associated :drops

  validates :name, presence: true, uniqueness: true
  validates :location, presence: true

  geocoded_by :location
  after_validation :geocode # eigene Methode schreiben, die daf`r sorgt lat and long gegeben werden, wenn es sie noch nicht gibt, oder wenn es neue
  # koordinaten . Damit lat und llong , wenn sie gegebn werden nicht ueberschrieben werden.

#   before_save :my_method_name, if: :method_name
#
#   private
#
#   def my_method_name
#     # fv,v,,vv
#   end
#
end<commit_msg>Change after_validation method to only geocode when the object doesn't have coordinates<commit_after>class Place < ActiveRecord::Base
  has_many :drops
  validates_associated :drops

  validates :name, presence: true, uniqueness: true
  validates :location, presence: true

  geocoded_by :location

  after_validation :geocode, unless: :geocoded?
end
{'fraction_non_alphanumeric': 0.07066381156316917, 'fraction_numerical': 0.0, 'mean_word_length': 4.880503144654088, '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': '613904', 'n_tokens_mistral': 306, 'n_tokens_neox': 297, 'n_words': 98}