quintel / etmoses

Online decision support tool to create local energy situations for neighbourhoods, cities and regions with a time resolution of 15 minutes created and maintained by Quintel – Not maintained
https://moses.energytransitionmodel.com
MIT License
11 stars 3 forks source link

Clear business case jobs when market model is edited #1422

Closed grdw closed 7 years ago

grdw commented 8 years ago

Pseudo code:

...
before_filter :clear_business_case_jobs, only: :update
...

private

def clear_business_case_jobs
  testing_ground_ids = TestingGround.where(market_model_id: @market_model.id).pluck(:id)
  BusinessCase.where(testing_ground_id: testing_ground_ids).each(&:clear_job!)
end