module ActiveAdmin::ResourceController::Scoping

def begin_of_association_chain

Collection can be scoped conditionally with an :if or :unless proc.

If scope_to is a proc, we eval it, otherwise we call the method on the controller.

the scope to be defined in the active admin configuration.
Override the default InheritedResource #begin_of_association_chain to allow
def begin_of_association_chain
  return nil unless active_admin_config.scope_to?(self)
  MethodOrProcHelper.render_in_context(self, active_admin_config.scope_to_method)
end

def method_for_association_chain

the scope_to option
Returns the method for the association chain when using

Overriding from InheritedResources::BaseHelpers
def method_for_association_chain
  active_admin_config.scope_to_association_method || super
end