Class: Project

Inherits:
ActiveRecordShared show all
Defined in:
app/models/project.rb

Overview

requires

* key ( unique ) * description ( unique and > 3 chars )

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.unenrolled_projects(study_subject) ⇒ Object

Returns all projects for which the study_subject does not have an enrollment



26
27
28
29
30
31
32
# File 'app/models/project.rb', line 26

def self.unenrolled_projects(study_subject)
	Project.all(
		:joins => "LEFT JOIN enrollments ON " <<
			"projects.id = enrollments.project_id AND " <<
			"enrollments.study_subject_id = #{study_subject.id}",
		:conditions => [ "enrollments.study_subject_id IS NULL" ])
end

Instance Method Details

#to_sObject

Returns description



35
36
37
# File 'app/models/project.rb', line 35

def to_s
	description
end