Memoize since these are invoked several times

This commit is contained in:
Jorge Manrubia
2025-11-03 07:30:23 +01:00
parent bc915c4b05
commit 825184ab1b
+2 -2
View File
@@ -29,7 +29,7 @@ module Attachments
end
def remote_images
rich_text_record&.body&.attachables&.grep(ActionText::Attachables::RemoteImage) || []
@remote_images ||= rich_text_record&.body&.attachables&.grep(ActionText::Attachables::RemoteImage) || []
end
def has_remote_images?
@@ -37,7 +37,7 @@ module Attachments
end
def remote_videos
rich_text_record&.body&.attachables&.grep(ActionText::Attachables::RemoteVideo) || []
@remote_videos ||= rich_text_record&.body&.attachables&.grep(ActionText::Attachables::RemoteVideo) || []
end
def has_remote_videos?