mirror of
https://github.com/internetee/registry.git
synced 2025-06-06 20:55:44 +02:00
parent
6fa1ce9128
commit
30ea880211
6 changed files with 8 additions and 60 deletions
|
@ -1,16 +0,0 @@
|
|||
namespace :data_migrations do
|
||||
task populate_invoice_issue_date: [:environment] do
|
||||
processed_invoice_count = 0
|
||||
|
||||
Invoice.transaction do
|
||||
Invoice.find_each do |invoice|
|
||||
invoice_issue_date = invoice.created_at.to_date
|
||||
invoice.update!(issue_date: invoice_issue_date)
|
||||
|
||||
processed_invoice_count += 1
|
||||
end
|
||||
end
|
||||
|
||||
puts "Invoices processed: #{processed_invoice_count}"
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue