app/models/activities/accountability_report.rb
def load_results(key, force = false)
    @log_step = key
    file_path = results_file_path(key)
    print "Loading results from #{file_path}... "
    if File.exist?(file_path)
      if force
        puts "force reload requested.\nForcing regeneration of #{key.to_s} results to #{file_path}..."
        return generate_results!(key)
      end
      @results = YAML::load(File.open(file_path))
      puts "done."
      puts "Read #{@results.size} results from #{File.mtime(file_path).to_s(:long)}"
    else
      puts "not found."
      @log_step = key
      generate_results!(key)
    end
  end
# Loads the results array from the YAML file cache produced by #dump_results!. If the cache file doesn't exist, this method
# regenerates the necessary results by calling generate_results!(key). To force this regeneration, pass +true+ for the +force+
# parameter.
Loads the results array from the YAML file cache produced by #dump_results!. If the cache file doesn't exist, this method
regenerates the necessary results by calling generate_results!(key). To force this regeneration, pass +true+ for the +force+
parameter.
Loads the results array from the YAML file cache produced by #dump_results! . If the cache file doesn ' t exist this method regenerates the necessary results by calling generate_results! ( key ) . To force this regeneration pass + true + for the + force + parameter .
def load_results(key, force = false)
    @log_step = key
    file_path = results_file_path(key)
    print "Loading results from #{file_path}... "
    if File.exist?(file_path)
      if force
        puts "force reload requested.\nForcing regeneration of #{key.to_s} results to #{file_path}..."
        return generate_results!(key)
      end
      @results = YAML::load(File.open(file_path))
      puts "done."
      puts "Read #{@results.size} results from #{File.mtime(file_path).to_s(:long)}"
    else
      puts "not found."
      @log_step = key
      generate_results!(key)
    end
  end
def load_results ( key , force = false ) @log_step = key file_path = results_file_path ( key ) print "Loading results from #{file_path}... " if File . exist? ( file_path ) if force puts "force reload requested.\nForcing regeneration of #{key.to_s} results to #{file_path}..." return generate_results! ( key ) end @results = YAML :: load ( File . open ( file_path ) ) puts "done." puts "Read #{@results.size} results from #{File.mtime(file_path).to_s(:long)}" else puts "not found." @log_step = key generate_results! ( key ) end end
Loads the results array from the YAML file cache produced by #dump_results!.
Loads the results array from the YAML file cache produced by #dump_results! .
key
force