class ResultObserver

Only here to support CombinedTimeTrialResults

Public Instance Methods

after_destroy(result) click to toggle source
# File app/models/observers/result_observer.rb, line 3
def after_destroy(result)
  return true unless result.event.notification_enabled?
  combined_results = CombinedTimeTrialResults.create_or_destroy_for!(result.event)
  result.event.combined_results.calculate! if result.event.combined_results
  true
end
after_save(result) click to toggle source
# File app/models/observers/result_observer.rb, line 10
def after_save(result)
  return true unless result.event(true).notification_enabled?
  combined_results = CombinedTimeTrialResults.create_or_destroy_for!(result.event)
  combined_results.calculate! unless combined_results.nil?
  true
end