diff --git a/lib/iknow_view_models/version.rb b/lib/iknow_view_models/version.rb index 46d591de..70f8420b 100644 --- a/lib/iknow_view_models/version.rb +++ b/lib/iknow_view_models/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module IknowViewModels - VERSION = '3.7.3' + VERSION = '3.8.0' end diff --git a/lib/view_model/controller.rb b/lib/view_model/controller.rb index 43a6d5de..3220b4b7 100644 --- a/lib/view_model/controller.rb +++ b/lib/view_model/controller.rb @@ -24,6 +24,8 @@ def prerender_viewmodel(viewmodel, status: nil, serialize_context: viewmodel.cla ViewModel.serialize(viewmodel, json, serialize_context: serialize_context) end + render_response_metadata(json, serialize_context: serialize_context) + if serialize_context && serialize_context.has_references? json.references do serialize_context.serialize_references(json) @@ -34,6 +36,9 @@ def prerender_viewmodel(viewmodel, status: nil, serialize_context: viewmodel.cla end end + def render_response_metadata(json, serialize_context:) + end + # Render an arbitrarily nested tree of hashes and arrays with pre-rendered # JSON string terminals. Useful for rendering cached views without parsing # then re-serializing the cached JSON.