Remove summary in phases form

Since it does not appear in the phases anymore.

Also, the rake unifies the fields of the budget summary with the budget
description.
This commit is contained in:
decabeza
2020-03-16 12:54:00 +01:00
committed by Javi Martín
parent f35a88cf4f
commit c0c458bb38
8 changed files with 105 additions and 75 deletions

View File

@@ -29,4 +29,17 @@ namespace :budgets do
end
end
end
desc "Copies the Budget::Phase summary into description"
task phases_summary_to_description: :environment do
ApplicationLogger.new.info "Adding budget phases summary to descriptions"
Budget::Phase::Translation.find_each do |translation|
if translation.summary.present?
translation.description << "<br>"
translation.description << translation.summary
translation.update!(summary: nil) if translation.save
end
end
end
end