app/models/offerings/offering_admin_phase.rb
def applications_for(result_type = :in_progress)
    @apps ||= {}
    return @apps[result_type] if @apps[result_type]
    @apps[result_type] = []
    result_type_array = [result_type] unless result_type.is_a?(Array)
    for t in result_type_array || result_type
      for status_type in status_types(t)
        if t.to_s == "success" || t.to_s == "failure"
          @apps[result_type] << offering.applications_past_status(status_type)
        else
          @apps[result_type] << offering.application_for_offerings.in_status(status_type)
        end
      end
    end
    @apps[result_type] = @apps[result_type].flatten.uniq.compact
  end
# If the result_type is :success or :failure, then find applications that are past this status.
# Otherwise, find applications that are currently in this status.
If the result_type is :success or :failure, then find applications that are past this status.
Otherwise, find applications that are currently in this status.
If the result_type is : success or : failure then find applications that are past this status . Otherwise find applications that are currently in this status .
def applications_for(result_type = :in_progress)
    @apps ||= {}
    return @apps[result_type] if @apps[result_type]
    @apps[result_type] = []
    result_type_array = [result_type] unless result_type.is_a?(Array)
    for t in result_type_array || result_type
      for status_type in status_types(t)
        if t.to_s == "success" || t.to_s == "failure"
          @apps[result_type] << offering.applications_past_status(status_type)
        else
          @apps[result_type] << offering.application_for_offerings.in_status(status_type)
        end
      end
    end
    @apps[result_type] = @apps[result_type].flatten.uniq.compact
  end
def applications_for ( result_type = :in_progress ) @apps ||= { } return @apps [ result_type ] if @apps [ result_type ] @apps [ result_type ] = [ ] result_type_array = [ result_type ] unless result_type . is_a? ( Array ) for t in result_type_array || result_type for status_type in status_types ( t ) if t . to_s == "success" || t . to_s == "failure" @apps [ result_type ] << offering . applications_past_status ( status_type ) else @apps [ result_type ] << offering . application_for_offerings . in_status ( status_type ) end end end @apps [ result_type ] = @apps [ result_type ] . flatten . uniq . compact end
If the result_type is :success or :failure, then find applications that are past this status.
If the result_type is : success or : failure then find applications that are past this status .
result_type