Merge branch 'dev_hjq' of http://repository.trustie.net/xianbo/trustie2 into dev_hjq
This commit is contained in:
commit
64e54cda75
|
@ -67,7 +67,29 @@ class BoardsController < ApplicationController
|
|||
|
||||
end
|
||||
|
||||
def show
|
||||
def show
|
||||
#¸üжÔÓ¦µÄforge_messages±íµÄviewed×Ö¶Î
|
||||
if @project
|
||||
query_forge_messages = @board.messages
|
||||
query_forge_messages.each do |query_forge_message|
|
||||
query = query_forge_message.forge_messages
|
||||
query.each do |forge_message|
|
||||
if User.current.id == forge_message.user_id
|
||||
forge_message.update_attributes(:viewed => true)
|
||||
end
|
||||
end
|
||||
end
|
||||
elsif @course
|
||||
query_course_messages = @board.messages
|
||||
query_course_messages.each do |query_course_message|
|
||||
query = query_course_message.course_messages
|
||||
query.each do |course_message|
|
||||
if User.current.id == course_message.user_id
|
||||
course_message.update_attributes(:viewed => true)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html {
|
||||
|
|
Loading…
Reference in New Issue