Merge commit 'fac734b6a8
' into kb_migration
This commit is contained in:
commit
5a661415e2
22 changed files with 121 additions and 14 deletions
|
@ -19,6 +19,7 @@ module StatusSnapshotConcern
|
|||
status_id: id,
|
||||
text: text,
|
||||
spoiler_text: spoiler_text,
|
||||
markdown: markdown,
|
||||
sensitive: sensitive,
|
||||
ordered_media_attachment_ids: ordered_media_attachment_ids&.dup || media_attachments.pluck(:id),
|
||||
media_descriptions: ordered_media_attachments.map(&:description),
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
# trendable :boolean
|
||||
# ordered_media_attachment_ids :bigint(8) is an Array
|
||||
# searchability :integer
|
||||
# markdown :boolean default(FALSE)
|
||||
#
|
||||
|
||||
require 'ostruct'
|
||||
|
@ -310,6 +311,10 @@ class Status < ApplicationRecord
|
|||
status_stat&.favourites_count || 0
|
||||
end
|
||||
|
||||
def emoji_reactions_count
|
||||
status_stat&.emoji_reactions_count || 0
|
||||
end
|
||||
|
||||
def increment_count!(key)
|
||||
update_status_stat!(key => public_send(key) + 1)
|
||||
end
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
# media_descriptions :text is an Array
|
||||
# poll_options :string is an Array
|
||||
# sensitive :boolean
|
||||
# markdown :boolean default(FALSE)
|
||||
#
|
||||
|
||||
class StatusEdit < ApplicationRecord
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
# updated_at :datetime not null
|
||||
# emoji_reactions :string
|
||||
# emoji_reactions_count :integer default(0), not null
|
||||
# test :integer default(0), not null
|
||||
#
|
||||
|
||||
class StatusStat < ApplicationRecord
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue