<commit_before>class Farm < ApplicationRecord
	belongs_to :user
	has_many :areas	
	has_many :animals, through: :areas

	validates :name, presence: true
	validates :name, uniqueness: true
	
	def areas_attributes=(areas_attributes)
		areas_attributes.values.each do |area_attributes|
			area = Area.find_by(name: area_attributes[:name])
			if area
				self.areas << area unless self.areas.include?(area)
			end
		end
	end

end<commit_msg>edited farm-area association<commit_after>class Farm < ApplicationRecord
	belongs_to :user
	has_many :areas, inverse_of: :farm, :dependent => :destroy
	has_many :animals, through: :areas

	validates :name, presence: true
	validates :name, uniqueness: true
	
	def areas_attributes=(areas_attributes)
		areas_attributes.values.each do |area_attributes|
			area = Area.find_by(name: area_attributes[:name])
			if area
				self.areas << area unless self.areas.include?(area)
			end
		end
	end

end
{'fraction_non_alphanumeric': 0.09364908503767493, 'fraction_numerical': 0.0, 'mean_word_length': 4.961538461538462, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 4, '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': '2925303', 'n_tokens_mistral': 337, 'n_tokens_neox': 305, 'n_words': 79}