Module: Immunio::ActiveSupportHooks

Extended by:
ActiveSupport::Concern
Defined in:
lib/immunio/plugins/action_view.rb

Overview

Hook for the ‘ActiveSupport::Hash#to_query`. Use case: building a url within a decorator that renders a partial with an interpolation.

Instance Method Summary collapse

Instance Method Details

#to_query_with_immunio(namespace = nil) ⇒ Object



521
522
523
524
525
526
527
528
529
530
# File 'lib/immunio/plugins/action_view.rb', line 521

def to_query_with_immunio(namespace = nil)
  escaped_string = to_query_without_immunio(namespace)
  Request.time "plugin", "#{Module.nesting[0]}::#{__method__}" do
    # Our markers got escaped, so un-unescaped them back.
    escaped_string.gsub!(
      Immunio::Template::ENCODED_IMMUNIO_TOKENS_RE,
      "{immunio-\\1:\\2:\\3}\\4{/immunio-\\1:\\2:\\3}")
  end
  escaped_string
end