Module: ActiveAdmin::ResourceController::Collection::Scoping

Includes:
ScopeChain
Included in:
ActiveAdmin::ResourceController::Collection
Defined in:
lib/active_admin/resource_controller/collection.rb

Instance Method Summary collapse

Methods included from ScopeChain

#scope_chain

Instance Method Details

#active_admin_collectionObject (protected)



89
90
91
# File 'lib/active_admin/resource_controller/collection.rb', line 89

def active_admin_collection
  scope_current_collection(super)
end

#current_scopeObject (protected)



104
105
106
107
108
109
110
# File 'lib/active_admin/resource_controller/collection.rb', line 104

def current_scope
  @current_scope ||= if params[:scope]
    active_admin_config.get_scope_by_id(params[:scope]) if params[:scope]
  else
    active_admin_config.default_scope
  end
end

#scope_current_collection(chain) ⇒ Object (protected)



93
94
95
96
97
98
99
100
# File 'lib/active_admin/resource_controller/collection.rb', line 93

def scope_current_collection(chain)
  if current_scope
    @before_scope_collection = chain
    scope_chain(current_scope, chain)
  else
    chain
  end
end