<commit_before>module RailsExtension::ActiveRecordExtension::Base
	def self.included(base)
		base.extend(ClassMethods)
	end

	module ClassMethods

		def random
			count = count()
			if count > 0
				first(:offset => rand(count))
			else
				nil
			end
		end

		def validates_absence_of(*attr_names)
			configuration = { :on => :save }
			configuration.update(attr_names.extract_options!)

			send(validation_method(configuration[:on]), configuration) do |record|
				attr_names.each do |attr_name|
					unless record.send(attr_name).blank?
						record.errors.add(attr_name, 
							ActiveRecord::Error.new(record,attr_name,:present,
								{ :message => configuration[:message] }))<commit_msg>Added default message for validates_absence_of.<commit_after>module RailsExtension::ActiveRecordExtension::Base
	def self.included(base)
		base.extend(ClassMethods)
	end

	module ClassMethods

		def random
			count = count()
			if count > 0
				first(:offset => rand(count))
			else
				nil
			end
		end

		def validates_absence_of(*attr_names)
			configuration = { :on => :save,
				:message => "is present and must be absent." }
			configuration.update(attr_names.extract_options!)

			send(validation_method(configuration[:on]), configuration) do |record|
				attr_names.each do |attr_name|
					unless record.send(attr_name).blank?
						record.errors.add(attr_name, 
							ActiveRecord::Error.new(record,attr_name,:present,
								{ :message => configuration[:message] }))
{'fraction_non_alphanumeric': 0.11261872455902307, 'fraction_numerical': 0.0013568521031207597, 'mean_word_length': 4.139372822299651, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '2007770', 'n_tokens_mistral': 558, 'n_tokens_neox': 440, 'n_words': 91}