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


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

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

#reorderable?Boolean

Returns:

  • (Boolean)

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

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

#reorderable_children?Boolean

Returns:

  • (Boolean)

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

def reorderable_children?
  !news_page?
end