diff --git a/app/models/message.rb b/app/models/message.rb index ae1cf5135..3680ed589 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -117,10 +117,6 @@ class Message < ApplicationRecord belongs_to :account belongs_to :inbox belongs_to :conversation, touch: true - - # FIXME: phase out user and contact after 1.4 since the info is there in sender - belongs_to :user, required: false - belongs_to :contact, required: false belongs_to :sender, polymorphic: true, required: false has_many :attachments, dependent: :destroy, autosave: true, before_add: :validate_attachments_limit diff --git a/app/views/api/v1/conversations/partials/_conversation.json.jbuilder b/app/views/api/v1/conversations/partials/_conversation.json.jbuilder index a36366f9e..3cd41efb9 100644 --- a/app/views/api/v1/conversations/partials/_conversation.json.jbuilder +++ b/app/views/api/v1/conversations/partials/_conversation.json.jbuilder @@ -22,7 +22,7 @@ if conversation.messages.first.blank? elsif conversation.unread_incoming_messages.count.zero? json.messages [conversation.messages.includes([{ attachments: [{ file_attachment: [:blob] }] }]).last.try(:push_event_data)] else - json.messages conversation.unread_messages.includes([:user, { attachments: [{ file_attachment: [:blob] }] }]).last(10).map(&:push_event_data) + json.messages conversation.unread_messages.includes([{ attachments: [{ file_attachment: [:blob] }] }]).last(10).map(&:push_event_data) end json.account_id conversation.account_id