mirror of
https://github.com/GSA/notifications-api.git
synced 2026-03-02 06:50:08 -05:00
Each notification instance is connected to a specific version of the template that was used to generate notification content. Template versions are stored in TemplateHistory, so that's the table we need to use for Notifications.template relationship. Currently, using Notifications.template returns the latest template version, which leads to incorrect content being returned by the API if the template has been updated. This change removes Notifications.template_history attribute and replaces template relationship to refer to TemplateHistory instance based on the notification's template ID and version.