From c8e769e05b9f95634a79f2a43f222169412c3f2e Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 7 Apr 2016 15:09:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E5=80=92=E5=BA=8F=E6=8E=92?= =?UTF-8?q?=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/mobile/entities/blog_comment.rb | 2 +- app/api/mobile/entities/issue.rb | 2 +- app/api/mobile/entities/jours.rb | 2 +- app/api/mobile/entities/message.rb | 2 +- app/api/mobile/entities/news.rb | 2 +- app/api/mobile/entities/whomework.rb | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/api/mobile/entities/blog_comment.rb b/app/api/mobile/entities/blog_comment.rb index 6961823d0..dad3f7a93 100644 --- a/app/api/mobile/entities/blog_comment.rb +++ b/app/api/mobile/entities/blog_comment.rb @@ -42,7 +42,7 @@ module Mobile blog_comment_expose :blog_praise_count expose :blog_comment_children, using:Mobile::Entities::BlogComment do |c,opt| if c.is_a? (::BlogComment) - c.children + c.children.reverse end end expose :has_praise , if: lambda { |instance, options| options[:user] } do |instance, options| diff --git a/app/api/mobile/entities/issue.rb b/app/api/mobile/entities/issue.rb index e64248353..41b9003d6 100644 --- a/app/api/mobile/entities/issue.rb +++ b/app/api/mobile/entities/issue.rb @@ -46,7 +46,7 @@ module Mobile issue_expose :issue_praise_count expose :issue_journals, using: Mobile::Entities::Journal do |f, opt| if f.is_a?(::Issue) - f.journals.where("notes is not null and notes != ''") + f.journals.where("notes is not null and notes != ''").reverse end end expose :has_praise , if: lambda { |instance, options| options[:user] } do |instance, options| diff --git a/app/api/mobile/entities/jours.rb b/app/api/mobile/entities/jours.rb index 87bbd0184..3d3e76e7c 100644 --- a/app/api/mobile/entities/jours.rb +++ b/app/api/mobile/entities/jours.rb @@ -48,7 +48,7 @@ module Mobile end expose :child_reply,using: Mobile::Entities::Jours do |f, opt| if f.is_a?(::JournalsForMessage) - f.children + f.children.reverse end end expose :has_praise , if: lambda { |instance, options| options[:user] } do |instance, options| diff --git a/app/api/mobile/entities/message.rb b/app/api/mobile/entities/message.rb index 7a00b5725..fe55bc090 100644 --- a/app/api/mobile/entities/message.rb +++ b/app/api/mobile/entities/message.rb @@ -49,7 +49,7 @@ module Mobile message_expose :lasted_comment expose :message_children,using:Mobile::Entities::Message do |c,opt| if c.is_a? (::Message) - c.children + c.children.reverse end end expose :has_praise , if: lambda { |instance, options| options[:user] } do |instance, options| diff --git a/app/api/mobile/entities/news.rb b/app/api/mobile/entities/news.rb index 85504a280..aab9a93b0 100644 --- a/app/api/mobile/entities/news.rb +++ b/app/api/mobile/entities/news.rb @@ -70,7 +70,7 @@ module Mobile if f.is_a?(Hash) && f.key?(:comments) f[:comments] elsif f.is_a?(::News) && f.respond_to?(:comments) - f.send(:comments) + f.comments.reverse end end expose :has_praise , if: lambda { |instance, options| options[:user] } do |instance, options| diff --git a/app/api/mobile/entities/whomework.rb b/app/api/mobile/entities/whomework.rb index 76b88ec6f..4c4dd2403 100644 --- a/app/api/mobile/entities/whomework.rb +++ b/app/api/mobile/entities/whomework.rb @@ -64,7 +64,7 @@ module Mobile expose :journals_for_messages, using: Mobile::Entities::Jours do |f, opt| #f[:journals_for_messages] if f.is_a?(Hash) && f.key?(:journals_for_messages) if f.is_a?(::HomeworkCommon) - f.journals_for_messages + f.journals_for_messages.reverse end end expose :has_praise , if: lambda { |instance, options| options[:user] } do |instance, options|