You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The attachments in ActionText::RichText rely on attachable_gid. The ActionText::Attachable#attachable_sgid value on objects returns different values based for version 1.1.0 and 1.2.0
Looks like the attachments are not necessarily broken. ActionText is able to find the attachment records with either of the sgids.
The issue is with how we implemented the serialisation and rendering of the rich text. We serialise the attachments separately from the ActionText::Richtext body and match them the sgid in the richtext with the sgid of the separately serialised objects. The objects are serialised with ActionText::Attachable#attachable_sgid.
All the attachments that were attached before v1.2.0 are using the previous sgid in the rich text and the serialised objects are returning a newer sgids. Therefore, our frontend couldn't match them to render appropriately.
--
For those who might land here, I managed to update the references in the richtext by running the following to update all the attachments in rich text.
The attachments in ActionText::RichText rely on
attachable_gid
. The ActionText::Attachable#attachable_sgid value on objects returns different values based for version 1.1.0 and 1.2.0Example:
on v1.1.0
on v1.2.0
This breaks are the attachments in the rich text editor for us.
What would be the best way to make sure we get the same attachable_sgid?
The text was updated successfully, but these errors were encountered: