Class: Link
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Link
- Defined in:
- app/models/link.rb
Instance Method Summary collapse
-
#path ⇒ Object
needed by menu_helper.
- #section ⇒ Object
- #section=(sec) ⇒ Object
- #section_id ⇒ Object
- #section_id=(sec_id) ⇒ Object
Instance Method Details
#path ⇒ Object
needed by menu_helper
31 32 33 |
# File 'app/models/link.rb', line 31 def path url end |
#section ⇒ Object
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_id ⇒ Object
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 |