<commit_before>#	==	requires
#	*	description ( unique and > 3 chars )
class SampleType < ActiveRecord::Base

	acts_as_list :scope => :parent_id
	acts_like_a_hash

	has_many :samples

	belongs_to :parent, :class_name => 'SampleType'
	has_many :children, 
		:class_name => 'SampleType',
		:foreign_key => 'parent_id',
		:dependent => :nullify
	
	scope :roots,     where( :parent_id => nil )
	scope :not_roots, where( 'sample_types.parent_id IS NOT NULL' )
	scope :for_new_samples, where( :for_new_sample => true )

#	def roots_for_new_samples
#		roots.for_new_samples
#	end
<commit_msg>Added 'for_new_sample' flag to sample_type for use on receive sample form.[#261]<commit_after>#	==	requires
#	*	description ( unique and > 3 chars )
class SampleType < ActiveRecord::Base

	acts_as_list :scope => :parent_id
	acts_like_a_hash

	has_many :samples

	belongs_to :parent, :class_name => 'SampleType'
	has_many :children, 
		:class_name => 'SampleType',
		:foreign_key => 'parent_id',
		:dependent => :nullify
	
	scope :roots,     where( :parent_id => nil )
	scope :not_roots, where( 'sample_types.parent_id IS NOT NULL' )
	scope :for_new_samples, where( :for_new_sample => true )

{'fraction_non_alphanumeric': 0.11914893617021277, 'fraction_numerical': 0.00425531914893617, 'mean_word_length': 5.0, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '1041830', 'n_tokens_mistral': 448, 'n_tokens_neox': 414, 'n_words': 104}