diff --git a/lib/tasks/data_migrations/populate_invoice_vat_rate.rake b/lib/tasks/data_migrations/populate_invoice_vat_rate.rake index 3bef60c0d9..3ae4a6a149 100644 --- a/lib/tasks/data_migrations/populate_invoice_vat_rate.rake +++ b/lib/tasks/data_migrations/populate_invoice_vat_rate.rake @@ -5,7 +5,7 @@ namespace :data_migrations do Invoice.transaction do Invoice.where(vat_rate: nil).find_each do |invoice| vat_rate = Invoice::VatRateCalculator.new(registrar: invoice.buyer).calculate - invoice.update_columns(vat_rate: vat_rate) + invoice.update!(vat_rate: vat_rate) processed_invoice_count += 1 end