app/models/applications/application_for_offering.rb
def past_applications
    return [] if offering.other_award_types.empty?
    offerings_to_include = offering.other_award_types.collect(&:offerings).flatten.uniq.compact
    conditions = "offering_id IN (#{offerings_to_include.collect(&:id).join(",")}) && offering_id != #{offering_id}"
    all = person.application_for_offerings.find(:all, :conditions => conditions, :include => :statuses)
    all.select{|a| a.passed_status?(:complete) rescue false}
  end
# Returns an array of previous applications from this student that meet these conditions:
# 
# * The application passed the "complete" status
# * The application is from an offering that matches one of the +other_award_type+s defined for this application's offering.
# * The application is not this application.
# 
# This is used for the review process.
Returns an array of previous applications from this student that meet these conditions:
The application passed the "complete" status
The application is from an offering that matches one of the +other_award_type+s defined for this application's offering.
The application is not this application.

This is used for the review process.
Returns an array of previous applications from this student that meet these conditions : The application passed the " complete " status The application is from an offering that matches one of the + other_award_type + s defined for this application ' s offering . The application is not this application . This is used for the review process .
def past_applications
    return [] if offering.other_award_types.empty?
    offerings_to_include = offering.other_award_types.collect(&:offerings).flatten.uniq.compact
    conditions = "offering_id IN (#{offerings_to_include.collect(&:id).join(",")}) && offering_id != #{offering_id}"
    all = person.application_for_offerings.find(:all, :conditions => conditions, :include => :statuses)
    all.select{|a| a.passed_status?(:complete) rescue false}
  end
def past_applications return [ ] if offering . other_award_types . empty? offerings_to_include = offering . other_award_types . collect ( & :offerings ) . flatten . uniq . compact conditions = "offering_id IN (#{offerings_to_include.collect(&:id).join(",")}) && offering_id != #{offering_id}" all = person . application_for_offerings . find ( :all , :conditions => conditions , :include => :statuses ) all . select { | a | a . passed_status? ( :complete ) rescue false } end
Returns an array of previous applications from this student that meet these conditions:
 The application passed the "complete" status
 The application is from an offering that matches one of the +other_award_type+s defined for this application's offering.
Returns an array of previous applications from this student that meet these conditions : The application passed the " complete " status The application is from an offering that matches one of the + other_award_type + s defined for this application ' s offering .