app/models/contract.rb
# get a list of all the students who are active and not already enrolled
# in this contract
get a list of all the students who are active and not already enrolled
in this contract
get a list of all the students who are active and not already enrolled in this contract
def users_open_for_enrollment
		User.find_by_sql "select u.* from users u 
			where u.status = #{User::STATUS_ACTIVE} and 
						u.id not in 
							(select e.participant_id from enrollments e where contract_id = #{id})
			order by last_name, first_name;"
	end
def users_open_for_enrollment User . find_by_sql "select u.* from users u 
			where u.status = #{User::STATUS_ACTIVE} and 
						u.id not in 
							(select e.participant_id from enrollments e where contract_id = #{id})
			order by last_name, first_name;" end
get a list of all the students who are active and not already enrolled
in this contract
get a list of all the students who are active and not already enrolled in this contract