1
0
Fork 0
forked from gitea/nas

Remove: kmyblue独自機能の引用

This commit is contained in:
KMY 2025-04-24 08:48:28 +09:00
parent 620a895184
commit d845d1e9fb
70 changed files with 812 additions and 1788 deletions

View file

@ -5,12 +5,11 @@
# Table name: status_references
#
# id :bigint(8) not null, primary key
# status_id :bigint(8) not null
# target_status_id :bigint(8) not null
# attribute_type :string
# created_at :datetime not null
# updated_at :datetime not null
# attribute_type :string
# quote :boolean default(FALSE), not null
# status_id :bigint(8) not null
# target_status_id :bigint(8) not null
#
class StatusReference < ApplicationRecord
@ -22,8 +21,6 @@ class StatusReference < ApplicationRecord
has_one :notification, as: :activity, dependent: :destroy
after_commit :reset_parent_cache
after_create_commit :set_quote
after_destroy_commit :remove_quote
private
@ -31,18 +28,4 @@ class StatusReference < ApplicationRecord
Rails.cache.delete("statuses/#{status_id}")
Rails.cache.delete("statuses/#{target_status_id}")
end
def set_quote
return unless quote
return if status.quote_of_id.present?
status.quote_of_id = target_status_id
end
def remove_quote
return unless quote
return unless status.quote_of_id == target_status_id
status.quote_of_id = nil
end
end