Merge branch 'develop' of 10.0.47.245:/home/trustie2 into develop

This commit is contained in:
Wen 2014-04-22 09:54:17 +08:00
commit dee5808407
4 changed files with 6 additions and 1 deletions

View File

@ -29,6 +29,7 @@ class Bid < ActiveRecord::Base
has_many :courses, :through => :homework_for_courses, :source => :project
has_many :homeworks, :class_name => 'HomeworkAttach', :dependent => :destroy
has_many :join_in_contests, :dependent => :destroy
has_many :praise_tread, as: :praise_tread_object, dependent: :destroy
# has_many :fork_homework, :class_name => 'Bid', :conditions => "#{Bid.table_name}.parent_id = #{id}"

View File

@ -12,6 +12,7 @@ class Contest < ActiveRecord::Base
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
has_many :join_in_competitions, foreign_key: 'competition_id', :dependent => :destroy
has_many :join_in_contests, class_name: 'JoinInCompetition', foreign_key: 'competition_id', :dependent => :destroy
has_many :praise_tread, as: :praise_tread_object, dependent: :destroy

View File

@ -46,6 +46,7 @@ class Issue < ActiveRecord::Base
# added by fq
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy
# end
has_many :praise_tread, as: :praise_tread_object, dependent: :destroy
acts_as_nested_set :scope => 'root_id', :dependent => :destroy

View File

@ -1,4 +1,6 @@
class PraiseTread < ActiveRecord::Base
attr_accessible :user_id,:praise_tread_object_id,:praise_tread_object_type,:praise_or_tread
belongs_to :user
belongs_to :praise_tread_object, polymorphic: true
end