diff options
author | David Gay <david@davidgay.org> | 2021-07-07 22:17:13 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-07-07 22:17:13 -0400 |
commit | 95fbf505e0876c5114048aa7c4dba39c39ba7bce (patch) | |
tree | 833e4896b3da52ec6129db64b884c7da93e72a60 | |
parent | 7ae14d1068ae357b2dc923aa04debd9a2cebe133 (diff) |
Fix chat messages order
-rw-r--r-- | app/controllers/chat_messages_controller.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/chat_messages_controller.rb b/app/controllers/chat_messages_controller.rb index a299379..444def1 100644 --- a/app/controllers/chat_messages_controller.rb +++ b/app/controllers/chat_messages_controller.rb @@ -1,10 +1,10 @@ class ChatMessagesController < ApplicationController def index - @chat_messages = ChatMessage.order(created_at: :desc).limit(2000) + @chat_messages = ChatMessage.order(created_at: :asc).limit(2000).reverse end def list - @chat_messages = ChatMessage.order(created_at: :asc).limit(200) + @chat_messages = ChatMessage.order(created_at: :desc).limit(200).reverse render partial: "chat_messages/list" end |