app/models/spud_menu.rb in tb_cms-1.1.5 vs app/models/spud_menu.rb in tb_cms-1.2.0.beta1
- old
+ new
@@ -1,7 +1,8 @@
class SpudMenu < ActiveRecord::Base
validates :name,:presence => true
validates_uniqueness_of :name, :scope => [:site_id]
+
has_many :spud_menu_items, :as => :parent, :dependent => :destroy
has_many :spud_menu_items_combined, :class_name => "SpudMenuItem", :foreign_key => :spud_menu_id, :dependent => :destroy
scope :site, lambda {|sid| where(:site_id => sid)}
end