mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-20 14:54:15 +01:00
[bug] prevent task migrate_pdf_invoices_folders from raising an error when run with no invoices
This commit is contained in:
parent
50373b6609
commit
e9f91a36e9
@ -1,6 +1,7 @@
|
|||||||
# Changelog Fab Manager
|
# 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
|
## v4.0.0 2019 June 17
|
||||||
|
|
||||||
|
@ -82,6 +82,8 @@ namespace :fablab do
|
|||||||
|
|
||||||
desc 'migrate PDF invoices to folders numbered by invoicing_profile'
|
desc 'migrate PDF invoices to folders numbered by invoicing_profile'
|
||||||
task migrate_pdf_invoices_folders: :environment do
|
task migrate_pdf_invoices_folders: :environment do
|
||||||
|
puts 'No invoices, exiting...' and return if Invoice.count.zero?
|
||||||
|
|
||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
Invoice.all.each do |i|
|
Invoice.all.each do |i|
|
||||||
invoicing_profile = i.invoicing_profile
|
invoicing_profile = i.invoicing_profile
|
||||||
|
Loading…
x
Reference in New Issue
Block a user