1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-17 11:54:22 +01:00

[bug] prevent task migrate_pdf_invoices_folders from raising an error when run with no invoices

This commit is contained in:
Sylvain 2019-06-17 15:01:23 +02:00
parent 50373b6609
commit e9f91a36e9
2 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,7 @@
# Changelog Fab Manager
- Fix a bug : cookie consent modal is not shown
- Fix a bug: cookie consent modal is not shown
- Fix a bug: prevent task migrate_pdf_invoices_folders from raising an error when run with no invoices
## v4.0.0 2019 June 17

View File

@ -82,6 +82,8 @@ namespace :fablab do
desc 'migrate PDF invoices to folders numbered by invoicing_profile'
task migrate_pdf_invoices_folders: :environment do
puts 'No invoices, exiting...' and return if Invoice.count.zero?
require 'fileutils'
Invoice.all.each do |i|
invoicing_profile = i.invoicing_profile