Rename methods to add auto links to HTML

The name `safe_html_with_links` was confusing and could make you think
it takes care of making the HTML safe. So I've renamed it in a way that
makes it a bit more intuitive that it expects its input to be already
sanitized.

I've changed `text_with_links` as well so now the two method names
complement each other.
This commit is contained in:
Javi Martín
2019-10-01 16:37:19 +02:00
parent 2ffbae890e
commit 2aabf79fb4
32 changed files with 38 additions and 38 deletions

View File

@@ -12,7 +12,7 @@ namespace :proposals do
model.find_each do |resource|
if resource.external_url.present?
Globalize.with_locale(I18n.default_locale) do
new_description = "#{resource.description} <p>#{text_with_links(resource.external_url)}</p>"
new_description = "#{resource.description} <p>#{sanitize_and_auto_link(resource.external_url)}</p>"
resource.description = new_description
resource.external_url = ""
resource.updated_at = Time.current