Merge branch 'develop' of http://repository.trustie.net/xianbo/trustie2 into develop

This commit is contained in:
sw 2015-09-06 12:10:11 +08:00
commit 56a96acbf0
4 changed files with 12 additions and 4 deletions

View File

@ -15,6 +15,8 @@ class CourseMessage < ActiveRecord::Base
after_create :add_user_message
def add_user_message
if MessageAll.where("message_type = '#{self.class.to_s}' and message_id = '#{self.id}'").first.nil?
self.message_alls << MessageAll.new(:user_id => self.user_id)
end
end
end

View File

@ -22,6 +22,8 @@ class ForgeMessage < ActiveRecord::Base
after_create :add_user_message
def add_user_message
if MessageAll.where("message_type = '#{self.class.to_s}' and message_id = '#{self.id}'").first.nil?
self.message_alls << MessageAll.new(:user_id => self.user_id)
end
end
end

View File

@ -12,6 +12,8 @@ class MemoMessage < ActiveRecord::Base
after_create :add_user_message
def add_user_message
if MessageAll.where("message_type = '#{self.class.to_s}' and message_id = '#{self.id}'").first.nil?
self.message_alls << MessageAll.new(:user_id => self.user_id)
end
end
end

View File

@ -11,6 +11,8 @@ class UserFeedbackMessage < ActiveRecord::Base
after_save :add_user_message
def add_user_message
if MessageAll.where("message_type = '#{self.class.to_s}' and message_id = '#{self.id}'").first.nil?
self.message_alls << MessageAll.new(:user_id => self.user_id)
end
end
end