|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
class Discuss < ActiveRecord::Base
|
|
|
|
|
belongs_to :user
|
|
|
|
|
attr_accessible :user_id, :content, :dis_id, :dis_type, :parent_id, :praise_count, :root_id, :challenge_id, :position, :reward
|
|
|
|
|
attr_accessible :user_id, :content, :dis_id, :dis_type, :parent_id, :praise_count, :root_id, :challenge_id,
|
|
|
|
|
:position, :reward, :hidden
|
|
|
|
|
default_scope :order => 'created_at desc'
|
|
|
|
|
|
|
|
|
|
has_many :praise_tread, as: :praise_tread_object, dependent: :destroy
|
|
|
|
|