diff options
| author | Teddy Wing | 2018-05-15 12:10:50 +0200 |
|---|---|---|
| committer | Teddy Wing | 2018-05-15 12:10:50 +0200 |
| commit | 3667a7d4976a9e69ae990df9ba681f679e0ee4fa (patch) | |
| tree | 5174364a7a9e1fafda588ed9be9cffc46f4fc220 /app | |
| parent | 72fd54c38b958d0be9d608a676e8fef84691d088 (diff) | |
| download | chouette-core-3667a7d4976a9e69ae990df9ba681f679e0ee4fa.tar.bz2 | |
CleanUp#clean: Replace `#destroy_*` calls with `#run_methods`
It turns out that we don't care about destroying orphaned data. From
Alban:
> Quand on duplique un JDD, on lance un CleanUp, sauf que la partie
> "suppression des données orphelines" n'intéresse personne au final.
Replace the calls to
`#destory_{vehicle_journeys,journey_patterns,routes}` with one to
`#run_methods`. This change allows callers to run any cleanup methods
defined in `CleanUp`. For example:
CleanUp.new(methods: [:destory_routes])
But now by default, none of these destroy methods are run, saving us
from doing extra work that it turns out we don't need to bother doing.
Refs #6854
Diffstat (limited to 'app')
| -rw-r--r-- | app/models/clean_up.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/app/models/clean_up.rb b/app/models/clean_up.rb index 4656cdb31..a708a77ea 100644 --- a/app/models/clean_up.rb +++ b/app/models/clean_up.rb @@ -49,9 +49,8 @@ class CleanUp < ApplicationModel # Disabled for the moment. See #5372 # destroy_time_tables_outside_referential - destroy_vehicle_journeys - destroy_journey_patterns - destroy_routes + # Run caller-specified cleanup methods + run_methods end end end |
