app/models/applications/application_reviewer.rb
def update_task_completion_status_cache!(tasks = nil)
    self.task_completion_status_cache ||= {}
    tasks ||= offering.tasks.find(:all, :conditions => "context = 'reviewers' AND completion_criteria != ''")
    tasks = [tasks] unless tasks.is_a?(Array)
    for task in tasks
      tcs = task_completion_statuses.find_or_create_by_task_id(task.id)
      tcs.result = self.instance_eval(task.completion_criteria.to_s)
      tcs.complete = tcs.result == true
      tcs.save
      self.task_completion_status_cache[task.id] = tcs.attributes
    end
    task_completion_status_cache
  end
# Goes through this Offering's phase tasks (with "reviewers" context) and checks the completion criteria for each. Then
# populates the +task_completion_status_cache+ hash using OfferingAdminPhaseTask id's as keys and the
# the attributes hash from OfferingAdminPhaseTaskCompletionStatus as values. If you just want to reset the cache
# for a specific set of tasks, pass the task as a parameter.
Goes through this Offering's phase tasks (with "reviewers" context) and checks the completion criteria for each. Then
populates the +task_completion_status_cache+ hash using OfferingAdminPhaseTask id's as keys and the
the attributes hash from OfferingAdminPhaseTaskCompletionStatus as values. If you just want to reset the cache
for a specific set of tasks, pass the task as a parameter.
Goes through this Offering ' s phase tasks ( with " reviewers " context ) and checks the completion criteria for each . Then populates the + task_completion_status_cache + hash using OfferingAdminPhaseTask id ' s as keys and the the attributes hash from OfferingAdminPhaseTaskCompletionStatus as values . If you just want to reset the cache for a specific set of tasks pass the task as a parameter .
def update_task_completion_status_cache!(tasks = nil)
    self.task_completion_status_cache ||= {}
    tasks ||= offering.tasks.find(:all, :conditions => "context = 'reviewers' AND completion_criteria != ''")
    tasks = [tasks] unless tasks.is_a?(Array)
    for task in tasks
      tcs = task_completion_statuses.find_or_create_by_task_id(task.id)
      tcs.result = self.instance_eval(task.completion_criteria.to_s)
      tcs.complete = tcs.result == true
      tcs.save
      self.task_completion_status_cache[task.id] = tcs.attributes
    end
    task_completion_status_cache
  end
def update_task_completion_status_cache! ( tasks = nil ) self . task_completion_status_cache ||= { } tasks ||= offering . tasks . find ( :all , :conditions => "context = 'reviewers' AND completion_criteria != ''" ) tasks = [ tasks ] unless tasks . is_a? ( Array ) for task in tasks tcs = task_completion_statuses . find_or_create_by_task_id ( task . id ) tcs . result = self . instance_eval ( task . completion_criteria . to_s ) tcs . complete = tcs . result == true tcs . save self . task_completion_status_cache [ task . id ] = tcs . attributes end task_completion_status_cache end
Goes through this Offering's phase tasks (with "reviewers" context) and checks the completion criteria for each.
Goes through this Offering ' s phase tasks ( with " reviewers " context ) and checks the completion criteria for each .
tasks