Sha256: feebcc44996c36a8ed77abcae925ae91874bfc4b80650a3ad6bb432b23ef5969
Contents?: true
Size: 570 Bytes
Versions: 18
Compression:
Stored size: 570 Bytes
Contents
class WebsiteNav < ActiveRecord::Base attr_protected :created_at, :updated_at protected_with_capabilities belongs_to :website validates_uniqueness_of :name, :scope => [:website_id], :message => "That Name is Already in Use", :case_sensitive => false has_many :website_nav_items, :dependent => :destroy do def positioned where('parent_id is null').order('position') end end def all_menu_items self.website_nav_items.collect{|item| item.self_and_descendants}.flatten end alias :items :website_nav_items end
Version data entries
18 entries across 18 versions & 1 rubygems