From 95f848f021b7480a1d121f851b4ab90466905cb7 Mon Sep 17 00:00:00 2001 From: taitus Date: Wed, 27 Mar 2019 22:41:44 +0100 Subject: [PATCH] Fix specs after rebase with translations branch - Fix spec spec/features/management/proposals_spec.rb:24 adding single quotes. - Remove spec related with 'proposal improvement info link' as master branch. - Fix proposal rake task (now proposals have translations). We put the 'validate: false' to keep the existing html tags in the proposal's description. Without the sanitizable module deleting them. --- lib/tasks/proposals.rake | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/tasks/proposals.rake b/lib/tasks/proposals.rake index 2fe3711ff..76b8a9f9d 100644 --- a/lib/tasks/proposals.rake +++ b/lib/tasks/proposals.rake @@ -11,10 +11,14 @@ namespace :proposals do print "Move external_url to description for #{model}s" model.find_each do |resource| if resource.external_url.present? - resource.update_columns(description: "#{resource.description} "\ - "

#{text_with_links(resource.external_url)}

", - external_url: "", updated_at: Time.current) - print "." + Globalize.with_locale(I18n.default_locale) do + new_description = "#{resource.description}

#{text_with_links(resource.external_url)}

" + resource.description = new_description + resource.external_url = "" + resource.updated_at = Time.current + resource.save(validate: false) + print "." + end end end puts " ✅ "