修改删除的关联的500问题

This commit is contained in:
huang 2015-08-21 11:28:10 +08:00
parent 947fcc160c
commit 580735ef79
1 changed files with 1 additions and 1 deletions

View File

@ -23,7 +23,7 @@ class News < ActiveRecord::Base
#added by nwb
belongs_to :course
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
has_many :comments, :as => :commented, :dependent => :delete_all, :order => "created_on"
has_many :comments, :as => :commented, :dependent => :destroy, :order => "created_on"
# fq
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
# 被ForgeActivity虚拟关联