Sha256: 9b0f25aee8eb240f21c8c46160fd644e243eb597f5b99c618c11d4209ca0216c

Contents?: true

Size: 746 Bytes

Versions: 1

Compression:

Stored size: 746 Bytes

Contents

class DocumentVersion < ActiveRecordShared

	acts_as_list
	default_scope :order => 'position, title ASC'

	belongs_to :document_type
	belongs_to :language
	has_many :enrollments

	validates_presence_of :document_type_id
	validates_presence_of :document_type, :if => :document_type_id

	validates_length_of   :title,       :maximum => 250, :allow_blank => true
	validates_length_of   :description, :maximum => 250, :allow_blank => true
	validates_length_of   :indicator,   :maximum => 250, :allow_blank => true

	validates_complete_date_for :began_use_on, :allow_nil => true
	validates_complete_date_for :ended_use_on, :allow_nil => true

	#	Return title
	def to_s
		title
	end

	named_scope :type1, :conditions => { :document_type_id => 1 }

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ccls-ccls_engine-3.11.0 app/models/document_version.rb