1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-20 14:54:15 +01:00

(feat) clean ghost availabilities and slots

This commit is contained in:
Sylvain 2023-02-20 16:55:45 +01:00
parent 3d2ccbf917
commit 1681dbdb76
2 changed files with 6 additions and 0 deletions

View File

@ -5,6 +5,7 @@
- Fix a bug: unable to start Fab-manager with message: maximum must be a nonnegative Integer
- Fix a bug: unable to export orders statistics
- Fix a bug: invalid shell coloring during setup
- [TODO DEPLOY] `fablab:maintenance:clean_availabilities`
## v5.7.0 2023 February 17

View File

@ -139,6 +139,11 @@ namespace :fablab do
puts '-> Done'
end
desc 'Remove ghost availabilities and slots'
task clean_availabilities: :environment do
Availability.where(available_type: 'unknown').destroy_all
end
def dates_from_args(args)
year = args.year || Time.current.year
month = args.month || Time.current.month