讨论区排序问题

dev_hs
jingquan huang 5 years ago
parent 6357d8f56d
commit 69de0943f5

@ -239,7 +239,7 @@ class ApplicationController < ActionController::Base
uid_logger("user_setup: " + (User.current.logged? ? "#{User.current.try(:login)} (id=#{User.current.try(:id)})" : "anonymous"))
if !User.current.logged? && Rails.env.development?
User.current = User.find 57703
User.current = User.find 12
end

@ -44,7 +44,8 @@ class MessagesController < ApplicationController
@current_user = current_user || nil
@messages = @message.children.preload_messages.includes(:message_detail, :praise_treads)
@messages = @messages.ordered(sort: 1) unless @message.parent_id.nil?
# @messages = @messages.ordered(sort: 1) unless @message.parent_id.nil?
@messages = @messages.order("created_on desc")
@user_course_identity = current_user.course_identity(@message.board.course)
case @user_course_identity

Loading…
Cancel
Save