pull
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
# group_id :integer
|
||||
# quote_of_id :bigint(8)
|
||||
# revised_at :datetime
|
||||
# markdown :text
|
||||
#
|
||||
|
||||
class Status < ApplicationRecord
|
||||
@@ -268,7 +269,6 @@ class Status < ApplicationRecord
|
||||
|
||||
after_create_commit :store_uri, if: :local?
|
||||
after_create_commit :update_statistics, if: :local?
|
||||
after_create_commit :increase_group_unread_counts, if: Proc.new { |status| !status.group_id.nil? }
|
||||
|
||||
around_create GabSocial::Snowflake::Callbacks
|
||||
|
||||
@@ -555,7 +555,4 @@ class Status < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
def increase_group_unread_counts
|
||||
GroupAccount.where(group_id: group_id).where.not(account_id: account_id).update_all("unread_count = unread_count + 1")
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user