Last active
February 17, 2021 16:24
-
-
Save pythonandchips/1c556f8adc08672bf316778bbed96038 to your computer and use it in GitHub Desktop.
Remove recurring invoices
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def delete_all_recurring_invoices | |
progress_bar = ProgressRateLimiter.new(count: Invoice.where(type: "RecurringInvoice").count) | |
Invoice.where(type: "RecurringInvoice").find_each do |recurring_invoice| | |
recurring_invoice.destroy! | |
progress_bar.increment! | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment