<commit_before>class Article < ActiveRecord::Base
	belongs_to :user
	belongs_to :category
	belongs_to :state
	belongs_to :agency
  has_many :events
  accepts_nested_attributes_for :events, :reject_if => :all_blank, :allow_destroy => true
	has_many :links
	accepts_nested_attributes_for :links, :reject_if => :all_blank, :allow_destroy => true
	has_many :article_officers
	has_many :officers, through: :article_officers
	accepts_nested_attributes_for :officers, :reject_if => :all_blank, :allow_destroy => true
	has_many :comments, as: :commentable

	has_paper_trail :only => [:title, :content, :overview, :litigation, :community_action]
	acts_as_followable
	extend FriendlyId
	friendly_id :title, use: [:slugged, :finders]
	searchkick

	validates :date, presence: { message: "Please add a date." }
	validates :title, presence:  { message: "Title (name of the victim) can't be blank." }
	validates :title, uniqueness: { message: "We already have an article with this victim" }
	validates :city, presence: { message: "Please add a city." }
	validates :state_id, presence: { message: "Please specify the state where this incident occurred before saving." }
	
	# Avatar uploader using carrierwave
	mount_uploader :avatar, AvatarUploader

	geocoded_by :full_address   # can also be an IP address
	after_validation :geocode          # auto-fetch coordinates

	def full_address
		"#{address} #{city} #{state}"
	end

	def self.find_by_search(query)
	    search(query)
	end

	def nearby_cases
		self.nearbys(50).order("distance")
	end

	def popover_content
		if self.overview.present?
			self.overview
		else
			self.content
		end
	end
private

end
<commit_msg>removing references to events association from article.rb<commit_after>class Article < ActiveRecord::Base
	belongs_to :user
	belongs_to :category
	belongs_to :state
	belongs_to :agency
	has_many :links
	accepts_nested_attributes_for :links, :reject_if => :all_blank, :allow_destroy => true
	has_many :article_officers
	has_many :officers, through: :article_officers
	accepts_nested_attributes_for :officers, :reject_if => :all_blank, :allow_destroy => true
	has_many :comments, as: :commentable

	has_paper_trail :only => [:title, :content, :overview, :litigation, :community_action]
	acts_as_followable
	extend FriendlyId
	friendly_id :title, use: [:slugged, :finders]
	searchkick

	validates :date, presence: { message: "Please add a date." }
	validates :title, presence:  { message: "Title (name of the victim) can't be blank." }
	validates :title, uniqueness: { message: "We already have an article with this victim" }
	validates :city, presence: { message: "Please add a city." }
	validates :state_id, presence: { message: "Please specify the state where this incident occurred before saving." }
	
	# Avatar uploader using carrierwave
	mount_uploader :avatar, AvatarUploader

	geocoded_by :full_address   # can also be an IP address
	after_validation :geocode          # auto-fetch coordinates

	def full_address
		"#{address} #{city} #{state}"
	end

	def self.find_by_search(query)
	    search(query)
	end

	def nearby_cases
		self.nearbys(50).order("distance")
	end

	def popover_content
		if self.overview.present?
			self.overview
		else
			self.content
		end
	end
private

end

{'fraction_non_alphanumeric': 0.09385612843470206, 'fraction_numerical': 0.001234949058351343, 'mean_word_length': 5.090225563909774, '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': '75316', 'n_tokens_mistral': 1107, 'n_tokens_neox': 1045, 'n_words': 312}