Sha256: f55c4644e17c7f1e6d3e84bae3678ffbcff74e1ec5fadb3b3464df9cf0bbf737
Contents?: true
Size: 496 Bytes
Versions: 10
Compression:
Stored size: 496 Bytes
Contents
class WebsiteNavItem < ActiveRecord::Base belongs_to :website_nav belongs_to :linked_to_item, :polymorphic => true has_roles acts_as_nested_set include ErpTechSvcs::Utils::DefaultNestedSetMethods def path linked_to_item.nil? ? url : linked_to_item.path end def positioned_children children.sort_by{|child| [child.position]} end def website_nav website_nav_id.nil? ? self.parent.website_nav : WebsiteNav.find(website_nav_id) end end
Version data entries
10 entries across 10 versions & 1 rubygems