Class: Link

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/link.rb

Instance Method Summary collapse

Instance Method Details

#pathObject

needed by menu_helper



31
32
33
# File 'app/models/link.rb', line 31

def path
  url
end

#sectionObject



14
15
16
# File 'app/models/link.rb', line 14

def section
  section_node ? section_node.section : nil
end

#section=(sec) ⇒ Object



22
23
24
25
26
27
28
# File 'app/models/link.rb', line 22

def section=(sec)
  if section_node
    section_node.move_to_end(sec)
  else
    build_section_node(:node => self, :section => sec)
  end      
end

#section_idObject



10
11
12
# File 'app/models/link.rb', line 10

def section_id
  section ? section.id : nil
end

#section_id=(sec_id) ⇒ Object



18
19
20
# File 'app/models/link.rb', line 18

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