app/models/user.rb
# gets a hash of contract status reports, indexed by enrollment ID, for the given user
gets a hash of contract status reports, indexed by enrollment ID, for the given user
gets a hash of contract status reports indexed by enrollment ID for the given user
def enrollment_status_reports(options = {})
	  default_options = {
	    :school_year => Setting.current_year
	  }
	  options = default_options.merge options
	  conditions = []
	  arguments = []
    conditions << "enrollments.participant_id = ?"
    arguments << self.id
	  conditions << "terms.school_year = ?"
	  arguments << options[:school_year]
	  q = []
	  q << "SELECT DISTINCT(statuses.id), statuses.* FROM statuses"
    q << "INNER JOIN enrollments ON statusable_id = enrollments.id AND statusable_type = 'Enrollment'"
    q << "INNER JOIN contracts ON enrollments.contract_id = contracts.id"
    q << "INNER JOIN terms ON contracts.term_id = terms.id"
    q << "WHERE ("
    q << conditions.join(') AND (')
	  q << ")"
	  q << "ORDER BY statuses.month"
	  Status.find_by_sql([q.join(' ')]+arguments)
	end
def enrollment_status_reports ( options = { } ) default_options = { :school_year => Setting . current_year } options = default_options . merge options conditions = [ ] arguments = [ ] conditions << "enrollments.participant_id = ?" arguments << self . id conditions << "terms.school_year = ?" arguments << options [ :school_year ] q = [ ] q << "SELECT DISTINCT(statuses.id), statuses.* FROM statuses" q << "INNER JOIN enrollments ON statusable_id = enrollments.id AND statusable_type = 'Enrollment'" q << "INNER JOIN contracts ON enrollments.contract_id = contracts.id" q << "INNER JOIN terms ON contracts.term_id = terms.id" q << "WHERE (" q << conditions . join ( ') AND (' ) q << ")" q << "ORDER BY statuses.month" Status . find_by_sql ( [ q . join ( ' ' ) ] + arguments ) end
gets a hash of contract status reports, indexed by enrollment ID, for the given user
gets a hash of contract status reports indexed by enrollment ID for the given user
# set enrollee ID # set school_year
options
<not_specific>