Module: PagesCore::PageModel::Sortable

Extended by:
ActiveSupport::Concern
Included in:
Page
Defined in:
app/models/concerns/pages_core/page_model/sortable.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#content_orderObject



34
35
36
37
38
39
40
# File 'app/models/concerns/pages_core/page_model/sortable.rb', line 34

def content_order
  if news_page?
    "pages.pinned DESC, published_at DESC"
  else
    "position ASC"
  end
end

#reorderable?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'app/models/concerns/pages_core/page_model/sortable.rb', line 30

def reorderable?
  !parent || !parent.news_page?
end

#reorderable_children?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'app/models/concerns/pages_core/page_model/sortable.rb', line 26

def reorderable_children?
  !news_page?
end