app/models/applications/application_for_offering.rb
# Returns true if this application was ever in the status requested. By default, this will NOT include applications
# that are currently cancelled, unless you pass +true+ as the second parameter.
# Note that this method respects the status "sequence." If you want to disregard status sequence, try #includes_status?.
Returns true if this application was ever in the status requested. By default, this will NOT include applications
that are currently cancelled, unless you pass +true+ as the second parameter.
Note that this method respects the status "sequence." If you want to disregard status sequence, try #includes_status?.
Returns true if this application was ever in the status requested . By default this will NOT include applications that are currently cancelled unless you pass + true + as the second parameter . Note that this method respects the status " sequence . " If you want to disregard status sequence try #includes_status? .
def passed_status?(s, include_cancelled = false, respect_sequence = true)
    return false if in_status?(:cancelled) && !include_cancelled
    s = s.to_s if s.is_a?(Symbol)
    if respect_sequence
      offering_status = offering.statuses.find(:first, 
        :joins => :application_status_type, 
        :conditions => { "application_status_types.name" => s})
      return false if offering_status && status_sequence < offering_status.sequence
    end
    statuses.collect(&:name).include?(s)
  end
def passed_status? ( s , include_cancelled = false , respect_sequence = true ) return false if in_status? ( :cancelled ) && ! include_cancelled s = s . to_s if s . is_a? ( Symbol ) if respect_sequence offering_status = offering . statuses . find ( :first , :joins => :application_status_type , :conditions => { "application_status_types.name" => s } ) return false if offering_status && status_sequence < offering_status . sequence end statuses . collect ( & :name ) . include? ( s ) end
Returns true if this application was ever in the status requested.
Returns true if this application was ever in the status requested .
s
include_cancelled
respect_sequence