Module: AdminSuite::LegacyCustomRendererProcs

Extended by:
Deprecation
Defined in:
lib/admin_suite/legacy_custom_renderer_procs.rb

Overview

Deprecation warning for config.custom_renderers[:key] = ->(record, view) {} procs (deprecated on paper since 0.4.0 — see CHANGELOG). They still take top precedence in render_custom_section, unchanged: Task 3 has tests pinning that. Unlike the four legacy Gleania renderers, though, these warned nothing at runtime, so a host mid-migration (trust_growth has 23 of them) has no signal to notice by. Warns once per key per process.

Constant Summary collapse

DEPRECATION_MESSAGE_FORMAT =
"AdminSuite: config.custom_renderers[:%<key>s] is a deprecated proc " \
"and will be removed in 0.5.0. Migrate to an AdminSuite::Renderer subclass."

Class Method Summary collapse

Methods included from Deprecation

reset_deprecation_notices!, warn_once, warn_once_sink

Class Method Details

.warn_once(key) ⇒ void

This method returns an undefined value.

Fires the deprecation sink at most once per key per process. warn_once_sink and reset_deprecation_notices! come from AdminSuite::Deprecation, extended above.

Parameters:

  • key (Symbol)


24
25
26
# File 'lib/admin_suite/legacy_custom_renderer_procs.rb', line 24

def warn_once(key)
  super(key, format(DEPRECATION_MESSAGE_FORMAT, key: key))
end