Class: Comfy::Archive::Index

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/comfy/archive/index.rb

Instance Method Summary collapse

Instance Method Details

#categories(published = false) ⇒ Object



31
32
33
34
# File 'app/models/comfy/archive/index.rb', line 31

def categories(published = false)
  category_ids = Comfy::Cms::Categorization.where(categorized_type: "Comfy::Cms::Page", categorized_id: self.children(published)).pluck(:category_id).uniq
  Comfy::Cms::Category.where(id: category_ids)
end

#children(published = false) ⇒ Object



23
24
25
26
27
28
29
# File 'app/models/comfy/archive/index.rb', line 23

def children(published = false)
  if published
    page.children.published
  else
    page.children
  end
end

#url(relative: false) ⇒ Object

– Instance Mathods ——————————————————–



19
20
21
# File 'app/models/comfy/archive/index.rb', line 19

def url(relative: false)
  page.url(relative: relative)
end