Module: Cms::Addressable::DeprecatedPageAccessors

Includes:
LeafNode, NodeAccessors
Included in:
Cms::Attachment, Link, Page
Defined in:
lib/cms/addressable.rb

Overview

These exist for backwards compatibility to avoid having to change tests. I want to get rid of these in favor of parent and parent_id

Instance Method Summary collapse

Methods included from NodeAccessors

#node, #node=

Methods included from LeafNode

#access_status

Instance Method Details

#build_node(opts) ⇒ Object



71
72
73
# File 'lib/cms/addressable.rb', line 71

def build_node(opts)
  build_section_node(opts)
end

#sectionObject



83
84
85
# File 'lib/cms/addressable.rb', line 83

def section
  parent
end

#section=(sec) ⇒ Object



87
88
89
90
# File 'lib/cms/addressable.rb', line 87

def section=(sec)
  self.parent = sec

end

#section_idObject



75
76
77
# File 'lib/cms/addressable.rb', line 75

def section_id
  section ? section.id : nil
end

#section_id=(sec_id) ⇒ Object



79
80
81
# File 'lib/cms/addressable.rb', line 79

def section_id=(sec_id)
  self.section = Section.find(sec_id)
end