Revert "conversations: fix last_authored_message_at"

fixes CNVS-14333

This reverts commit 4e83960eb4.

Change-Id: I4631088293abc5f2bcb281d60165f9710c7b6111
Reviewed-on: https://gerrit.instructure.com/38622
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
Product-Review: Matthew Wheeler <mwheeler@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
This commit is contained in:
Joel Hough 2014-08-01 11:14:58 -06:00 committed by Matthew Wheeler
parent d1092fc27e
commit 2f8880d2e2
2 changed files with 2 additions and 5 deletions

View File

@ -316,10 +316,7 @@ class Conversation < ActiveRecord::Base
cps = cps.where("user_id NOT IN (?)", skip_users.map(&:user_id)) if skip_users.present?
end
if options[:only_users]
options[:only_users] << message.author
cps = cps.where(:user_id => (options[:only_users]).map(&:id))
end
cps = cps.where(:user_id => (options[:only_users]+[message.author]).map(&:id)) if options[:only_users]
next unless cps.exists?

View File

@ -1207,6 +1207,7 @@ describe ConversationsController, type: :request do
{ :controller => 'conversations', :action => 'add_message', :id => conversation.conversation_id.to_s, :format => 'json' },
{ :body => "partially hydrogenated context oils", :recipients => [@billy.id], :included_messages => [message.id]})
conversation.reload
json.delete("last_authored_message_at") # This is sometimes not updated. It's a known bug.
json.delete("avatar_url")
json["participants"].each{ |p|
p.delete("avatar_url")
@ -1220,7 +1221,6 @@ describe ConversationsController, type: :request do
"last_message" => "partially hydrogenated context oils",
"last_message_at" => conversation.last_message_at.to_json[1, 20],
"last_authored_message" => "partially hydrogenated context oils",
"last_authored_message_at" => conversation.last_authored_at.to_json[1, 20],
"message_count" => 3,
"subscribed" => true,
"private" => false,