From ab1477997a181afdbd580c8fdad4b41bbc0a402b Mon Sep 17 00:00:00 2001 From: Urban Rotnik Date: Tue, 9 Mar 2021 11:02:52 +0100 Subject: [PATCH] Update variables name --- app/helpers/global_activities_helper.rb | 4 ++-- app/models/concerns/generate_notification_model.rb | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/helpers/global_activities_helper.rb b/app/helpers/global_activities_helper.rb index 4278d767c..4fe5e5c0f 100644 --- a/app/helpers/global_activities_helper.rb +++ b/app/helpers/global_activities_helper.rb @@ -5,7 +5,7 @@ module GlobalActivitiesHelper include ActionView::Helpers::UrlHelper include InputSanitizeHelper - def generate_activity_content(activity, no_links: false, no_sanitization: false) + def generate_activity_content(activity, no_links: false, no_custom_links: false) parameters = {} activity.message_items.each do |key, value| parameters[key] = @@ -18,7 +18,7 @@ module GlobalActivitiesHelper end end - if no_sanitization + if no_custom_links I18n.t("global_activities.content.#{activity.type_of}_html", parameters.symbolize_keys) else custom_auto_link( diff --git a/app/models/concerns/generate_notification_model.rb b/app/models/concerns/generate_notification_model.rb index f28c50bd0..4273efaae 100644 --- a/app/models/concerns/generate_notification_model.rb +++ b/app/models/concerns/generate_notification_model.rb @@ -11,7 +11,7 @@ module GenerateNotificationModel def generate_notification_from_activity return if notification_recipients.none? - message = generate_activity_content(self, no_links: true, no_sanitization: true) + message = generate_activity_content(self, no_links: true, no_custom_links: true) description = generate_notification_description_elements(subject).reverse.join(' | ') notification = Notification.create( @@ -54,6 +54,7 @@ module GenerateNotificationModel users - [owner] end + # This method returns unsanitized elements. They must be sanitized before saving to DB def generate_notification_description_elements(object, elements = []) case object when Project