Fixed embedded DM show mode for versioned definitions#1241
Open
philayres wants to merge 4 commits into
Open
Conversation
added 4 commits
June 19, 2026 17:39
91ac971 to
fcc7e16
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1238 — activity log embedded dynamic model items fail to render in read-only (show) mode when the embedded model uses definition versioning.
Root Cause
Two related issues in the Handlebars template config generation:
Alias loop missing version key in
app/views/common_templates/_search_results_template.html.erb: When aliasing an embedded dynamic model's template config onto the plural resource name, only the base object was aliased. The browser JS looks uptemplate_config.<resource_name>.v<def_version>— the version-specific key was never copied onto the alias.Global template missing historical versions in
app/views/dynamic_models/_search_results_template.html.erb: The global template (loaded once at page load) only emitted JS config for the current (live) definition version. After a definition version bump, embedded DM records carry an olderdef_versionkey that was absent from the global template.Fix
common_templates/_search_results_template.html.erb: The alias loop now also copies the.v<def_version>key onto each alternative resource name.dynamic_models/_search_results_template.html.erb: Now iteratesm.all_versionsto also emit lightweight JS config blocks for all historical definition versions (Handlebars HTML template re-rendering is skipped for historical versions via the existingunless def_versionguard).Tests
spec/requests/activity_log/embedded_versioned_template_config_spec.rb): New spec asserting thetemplate_configendpoint correctly aliases the per-version template onto the plural resource name, for both versioned and unversioned embedded dynamic models, including when the embedded record was created under an older definition version.spec/system/activity_log/embedded_versioned_show_mode_spec.rb): Browser-level acceptance tests covering: