mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-30 07:36:21 +00:00
Merge branch 'issue-15109-1' of https://0xacab.org/sutty/sutty into production.panel.sutty.nl
This commit is contained in:
commit
0d5298fc2d
2 changed files with 4 additions and 3 deletions
|
@ -53,7 +53,8 @@ module Api
|
||||||
instance.present?
|
instance.present?
|
||||||
object.present?
|
object.present?
|
||||||
activity.present?
|
activity.present?
|
||||||
activity_pub.approve! if activity_pub.may_approve?
|
activity_pub.update(aasm_state: 'approved')
|
||||||
|
activity.update_activity_pub_state!
|
||||||
end
|
end
|
||||||
|
|
||||||
head :accepted
|
head :accepted
|
||||||
|
@ -69,7 +70,7 @@ module Api
|
||||||
instance.present?
|
instance.present?
|
||||||
object.present?
|
object.present?
|
||||||
activity.present?
|
activity.present?
|
||||||
activity_pub.reject! if activity_pub.may_reject?
|
activity_pub.update(aasm_state: 'rejected')
|
||||||
end
|
end
|
||||||
|
|
||||||
head :accepted
|
head :accepted
|
||||||
|
|
|
@ -18,7 +18,7 @@ class ActivityPub < ApplicationRecord
|
||||||
belongs_to :site
|
belongs_to :site
|
||||||
belongs_to :object, polymorphic: true
|
belongs_to :object, polymorphic: true
|
||||||
belongs_to :actor
|
belongs_to :actor
|
||||||
belongs_to :remote_flag, class_name: 'ActivityPub::RemoteFlag'
|
belongs_to :remote_flag, optional: true, class_name: 'ActivityPub::RemoteFlag'
|
||||||
has_many :activities
|
has_many :activities
|
||||||
|
|
||||||
validates :site_id, presence: true
|
validates :site_id, presence: true
|
||||||
|
|
Loading…
Reference in a new issue