class ActiveAdmin::ResourceController::Decorators::Wrapper

Public Class Methods

find_collection_decorator(decorator) click to toggle source
# File lib/active_admin/resource_controller/decorators.rb, line 71
def self.find_collection_decorator(decorator)
  if decorator.respond_to?(:collection_decorator_class)
    decorator.collection_decorator_class
  else
    CollectionDecorator
  end
end
wrap(decorator) click to toggle source
# File lib/active_admin/resource_controller/decorators.rb, line 55
def self.wrap(decorator)
  collection_decorator = find_collection_decorator(decorator)
  name = "#{collection_decorator.name} of #{decorator} + ActiveAdmin"
  @cache[name] ||= wrap! collection_decorator, name
end
wrap!(parent, name) click to toggle source
# File lib/active_admin/resource_controller/decorators.rb, line 61
def self.wrap!(parent, name)
  ::Class.new parent do
    delegate :reorder, :page, :current_page, :total_pages, :limit_value,
             :total_count, :offset, :to_key, :group_values,
             :except, :find_each, :ransack, to: :object

    define_singleton_method(:name) { name }
  end
end