Update variables name

This commit is contained in:
Urban Rotnik 2021-03-09 11:02:52 +01:00
parent 1bb2393655
commit ab1477997a
2 changed files with 4 additions and 3 deletions

View file

@ -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(

View file

@ -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