From 9526962c69fabcb8507c5bb876ff050ba78fb5fb Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 6 May 2016 22:06:24 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E7=BF=BB=E9=A1=B5=E6=97=B6=E4=B8=8D?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BD=9C=E4=B8=9A=E5=8A=A8=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 57fa7ada5..e724846d6 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -11,7 +11,9 @@ class HomeworkCommonController < ApplicationController before_filter :member_of_course, :only => [:index] def index - update_homework_time(@course.homework_commons) + unless params[:page] + update_homework_time(@course.homework_commons) + end @new_homework = HomeworkCommon.new @new_homework.homework_detail_manual = HomeworkDetailManual.new @new_homework.course = @course From 90809ea350d808a5fae65198c4596f934462d0c2 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 6 May 2016 22:18:31 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/_org_course_homework.html.erb | 2 +- app/views/users/_course_homework.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/organizations/_org_course_homework.html.erb b/app/views/organizations/_org_course_homework.html.erb index 068d50437..19cdcf2f1 100644 --- a/app/views/organizations/_org_course_homework.html.erb +++ b/app/views/organizations/_org_course_homework.html.erb @@ -183,7 +183,7 @@
<% first_pro = project_sort_first(projects).first %> - # <%=time_from_now first_pro.first.updated_at %><%= link_to User.find(first_pro.first.user_id).show_name, user_activities_url_in_org(first_pro.first.user_id), :class => "newsBlue ml5 mr5"%>更新了项目,最近更新: + # <%=time_from_now first_pro.updated_at %><%= link_to User.find(first_pro.user_id).show_name, user_activities_url_in_org(first_pro.user_id), :class => "newsBlue ml5 mr5"%>更新了项目,最近更新:
<% sort_projects.each_with_index do |pro, i| %> diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index 2d2b53779..b6ea36de5 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -192,7 +192,7 @@
<% first_pro = project_sort_first(projects).first %> - # <%=time_from_now first_pro.first.updated_at %><%= link_to User.find(first_pro.first.user_id).show_name, user_activities_path(first_pro.first.user_id), :class => "newsBlue ml5 mr5"%>更新了项目,最近更新: + # <%=time_from_now first_pro.updated_at %><%= link_to User.find(first_pro.user_id).show_name, user_activities_path(first_pro.user_id), :class => "newsBlue ml5 mr5"%>更新了项目,最近更新:
<% sort_projects.each_with_index do |pro, i| %> From 2a55d8f0c35a9d378b0547a87917eee482c82ac7 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 6 May 2016 22:23:05 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=9A=84=E5=9B=9E?= =?UTF-8?q?=E5=A4=8D=E6=9B=B4=E6=96=B0=E4=BD=9C=E4=B8=9A=E7=9A=84updated?= =?UTF-8?q?=5Fat=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/words_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index c89a98a91..e17f03c38 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -276,7 +276,7 @@ class WordsController < ApplicationController ids = params[:asset_id].split(',') update_kindeditor_assets_owner ids,feedback[:id],OwnerTypeHelper::JOURNALSFORMESSAGE end - @homework_common.update_attributes(:updated_at => Time.now) + @homework_common.update_column('updated_at', Time.now) update_course_activity(@homework_common.class,@homework_common.id) update_user_activity(@homework_common.class,@homework_common.id) update_org_activity(@homework_common.class,@homework_common.id) @@ -311,7 +311,7 @@ class WordsController < ApplicationController ids = params[:asset_id].split(',') update_kindeditor_assets_owner ids,feedback[:id],OwnerTypeHelper::JOURNALSFORMESSAGE end - @homework_common.update_attributes(:updated_at => Time.now) + @homework_common.update_column('updated_at', Time.now) update_course_activity(@homework_common.class,@homework_common.id) update_user_activity(@homework_common.class,@homework_common.id) update_org_activity(@homework_common.class,@homework_common.id)