From 12792d1482f3b5842ddbd199297cbb2646a63ff2 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Tue, 4 Jun 2019 10:33:46 +0300 Subject: [PATCH] Use bang method --- lib/tasks/data_migrations/populate_invoice_vat_rate.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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