mirror of
https://0xacab.org/sutty/sutty
synced 2025-02-18 02:31:50 +00:00
Merge branch 'issue-15109-1' of https://0xacab.org/sutty/sutty into production.panel.sutty.nl
This commit is contained in:
commit
8437234eb3
1 changed files with 7 additions and 0 deletions
|
@ -9,6 +9,7 @@ class ActivityPub
|
|||
|
||||
# Los objetos son únicos a toda la base de datos
|
||||
validates :uri, presence: true, url: true, uniqueness: true
|
||||
validate :uri_is_content_id?, if: :content?
|
||||
|
||||
has_many :activity_pubs, as: :object
|
||||
|
||||
|
@ -43,6 +44,12 @@ class ActivityPub
|
|||
|
||||
private
|
||||
|
||||
def uri_is_content_id?
|
||||
return if self.uri == content['id']
|
||||
|
||||
errors.add(:activity_pub_objects, 'El ID del objeto no coincide con su URI')
|
||||
end
|
||||
|
||||
# Encuentra el tipo a partir del contenido, si existe.
|
||||
#
|
||||
# XXX: Si el objeto es una actividad, esto siempre va a ser
|
||||
|
|
Loading…
Reference in a new issue