Progress
Albums almost done, group, chat moderation, photo, video page updates
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
# is_muted :boolean default(FALSE), not null
|
||||
#
|
||||
|
||||
# : todo : expires
|
||||
# : todo : max per account
|
||||
class ChatConversationAccount < ApplicationRecord
|
||||
include Paginable
|
||||
|
||||
26
app/models/form/chat_message_batch.rb
Normal file
26
app/models/form/chat_message_batch.rb
Normal file
@@ -0,0 +1,26 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Form::ChatMessageBatch
|
||||
include ActiveModel::Model
|
||||
include AccountableConcern
|
||||
|
||||
attr_accessor :chat_message_ids, :action, :current_account
|
||||
|
||||
def save
|
||||
case action
|
||||
when 'delete'
|
||||
delete_chat_messages
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def delete_chat_messages
|
||||
ChatMessage.where(id: chat_message_ids).reorder(nil).find_each do |chat_message|
|
||||
DeleteChatMessageWorker.perform_async(chat_message.id)
|
||||
log_action :destroy, chat_message
|
||||
end
|
||||
|
||||
true
|
||||
end
|
||||
end
|
||||
@@ -12,11 +12,10 @@
|
||||
#
|
||||
|
||||
class Shortcut < ApplicationRecord
|
||||
# : todo : enum 1,2, etc.
|
||||
# enum shortcut_type: {
|
||||
# account: 'account',
|
||||
# group: 'group'
|
||||
# }
|
||||
SHORTCUT_TYPE_MAP = {
|
||||
account: 'account',
|
||||
group: 'group',
|
||||
}.freeze
|
||||
|
||||
belongs_to :account
|
||||
|
||||
|
||||
Reference in New Issue
Block a user