<commit_before>class Census < ActiveRecord::Base
		belongs_to :room
		
		def tally(num_bats, room)
			self.room = room
			if self.animals != nil
				self.animals = self.animals + num_bats
			else
				last_census = Census.find(:first, :order => 'date desc', :conditions => 'room_id = ' + room.id.to_s)
				last_census ? self.animals = last_census.animals + num_bats : self.animals = num_bats
			end
			self.save
		end
end<commit_msg>Fixed bug where census wasn't getting updated.<commit_after>class Census < ActiveRecord::Base
		belongs_to :room
		
		def tally(num_bats, room)
			self.room = room
			if self.animals != nil
				self.animals = self.animals + num_bats
			else
				last_census = Census.find(:first, :order => 'date desc', :conditions => 'room_id = ' + room.id.to_s)
				if last_census && last_census.animals
          self.animals = last_census.animals + num_bats
        else 
          self.animals = num_bats
        end
			end
			self.save
		end
end
{'fraction_non_alphanumeric': 0.10466321243523316, 'fraction_numerical': 0.0, 'mean_word_length': 2.9753086419753085, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '7533973', 'n_tokens_mistral': 389, 'n_tokens_neox': 321, 'n_words': 79}