app/models/offerings/offering.rb
def awards_mapping(status = :confirmed)
    OFFERINGS_CACHE.fetch("awards_mapping_#{id}_#{status.to_s.underscore}", :expires_in => 24.hours) do
      @apps = application_for_offerings.with_status(status)
      awards = {}
      for iapp in @apps
        award = iapp.other_awards.collect(&:scholar_title).flatten.compact
        for index in (0...award.length)
          awards[award[index]] = (awards[award[index]].nil? ? [iapp.id] : awards[award[index]] << iapp.id) unless award.blank?  
        end
      end      
      awards
    end
  end
# Creates (or restores from cache) a hash with keys of award names and values of arrays of application ID numbers.
# Default cache is 24 hours.
Creates (or restores from cache) a hash with keys of award names and values of arrays of application ID numbers.
Default cache is 24 hours.
Creates ( or restores from cache ) a hash with keys of award names and values of arrays of application ID numbers . Default cache is 24 hours .
def awards_mapping(status = :confirmed)
    OFFERINGS_CACHE.fetch("awards_mapping_#{id}_#{status.to_s.underscore}", :expires_in => 24.hours) do
      @apps = application_for_offerings.with_status(status)
      awards = {}
      for iapp in @apps
        award = iapp.other_awards.collect(&:scholar_title).flatten.compact
        for index in (0...award.length)
          awards[award[index]] = (awards[award[index]].nil? ? [iapp.id] : awards[award[index]] << iapp.id) unless award.blank?  
        end
      end      
      awards
    end
  end
def awards_mapping ( status = :confirmed ) OFFERINGS_CACHE . fetch ( "awards_mapping_#{id}_#{status.to_s.underscore}" , :expires_in => 24 . hours ) do @apps = application_for_offerings . with_status ( status ) awards = { } for iapp in @apps award = iapp . other_awards . collect ( & :scholar_title ) . flatten . compact for index in ( 0 ... award . length ) awards [ award [ index ] ] = ( awards [ award [ index ] ] . nil? ? [ iapp . id ] : awards [ award [ index ] ] << iapp . id ) unless award . blank? end end awards end end
Creates (or restores from cache) a hash with keys of award names and values of arrays of application ID numbers.
Creates ( or restores from cache ) a hash with keys of award names and values of arrays of application ID numbers .
status