Move out `render_field` and `cacheless_render_field` methods from Banzai::Renderer
Description
Banzai::Renderer module violates SRP.
It knows too much about models' fields, cachable fields, and models' methods of storing rendered markdown values.
Banzai::Renderer should just transform original text passing it through a set of filters collected in a chosen pipeline, and just render a result back to a caller.
It should know nothing about where a result is going to be used further.
Proposal
- Remove the Banzai::Renderer.render_field and Banzai::Renderer.cacheless_render_field methods from
Banzai
. - Add a method to the cache_markdown_field concern which will invoke Banzai::Renderer.render, get a result and store it as a cache if needed.
Why
The Banzai architecture will be easier to read and understand by developers.