Module: ActiveAdmin::FriendlyIdDisabler

Extended by:
ActiveSupport::Concern
Defined in:
lib/activeadmin/friendly_id_disabler.rb

Overview

This module disables FriendlyId for the duration of the specified action.

Instance Method Summary collapse

Instance Method Details

#disable_friendly_id(&action) ⇒ Object

Note:

This method leverages a thread-local variable to manage the disabled state, ensuring that the disabling is scoped to the current thread only.

Temporarily disables FriendlyId functionality within the given block.

Parameters:

  • action (Proc) —

    the block of code (typically a controller action) during which FriendlyId should be disabled.



28
29
30
# File 'lib/activeadmin/friendly_id_disabler.rb', line 28

def disable_friendly_id(&action)
  ::FriendlyId::Disabler.disable_friendly_id(&action)
end