<commit_before>class IccaSite < ApplicationRecord
  before_destroy :safe_to_destroy, prepend: true
  belongs_to :country
  has_many :pages, class_name: "Comfy::Cms::Page"

  private

  def safe_to_destroy
    if pages.any?
      errors[:base] << "Attempted to delete #{self.name}, but pages found associated with that site. Delete those pages and try again."
      throw :abort
    end
  end

end<commit_msg>feat: restrict longitude and latitude to +/- 180<commit_after>class IccaSite < ApplicationRecord
  before_destroy :safe_to_destroy, prepend: true
  belongs_to :country
  has_many :pages, class_name: "Comfy::Cms::Page"

  validates :lon, :lat, numericality: { greater_than_or_equal_to: -180, less_than_or_equal_to: 180 }

  private

  def safe_to_destroy
    if pages.any?
      errors[:base] << "Attempted to delete #{self.name}, but pages found associated with that site. Delete those pages and try again."
      throw :abort
    end
  end

end
{'fraction_non_alphanumeric': 0.08709338929695698, 'fraction_numerical': 0.00944386149003148, 'mean_word_length': 4.129032258064516, 'pattern_counts': {'":': 0, '<': 9, '<?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': '4856432', 'n_tokens_mistral': 313, 'n_tokens_neox': 297, 'n_words': 95}