Class: Pageflow::Admin::CustomScopesRenderer

Inherits:
ActiveAdmin::Views::Scopes
  • Object
show all
Defined in:
app/views/components/pageflow/admin/custom_scopes_renderer.rb

Instance Method Summary collapse

Instance Method Details

#build(scopes, options = {}) ⇒ Object


6
7
8
9
# File 'app/views/components/pageflow/admin/custom_scopes_renderer.rb', line 6

def build(scopes, options = {})
  @default_scope = options.delete(:default_scope)
  super
end

#current_scope?(scope) ⇒ Boolean


11
12
13
14
15
16
17
# File 'app/views/components/pageflow/admin/custom_scopes_renderer.rb', line 11

def current_scope?(scope)
  if params[:scope]
    params[:scope] == scope.id
  else
    @default_scope.to_s == scope.id
  end
end